Class WindowCache.StatsRecorderImpl
java.lang.Object
org.eclipse.jgit.internal.storage.file.WindowCache.StatsRecorderImpl
- All Implemented Interfaces:
WindowCache.StatsRecorder
,WindowCacheStats
- Enclosing class:
- WindowCache
static class WindowCache.StatsRecorderImpl
extends Object
implements WindowCache.StatsRecorder, WindowCacheStats
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an instance with all counts initialized to zero. -
Method Summary
Modifier and TypeMethodDescriptionlong
Number of cache evictionslong
Number of cache hitslong
Number of failed loadslong
Number of successful loadslong
Number of cache misses.long
Number of bytes cachedNumber of bytes cached per repositorylong
Number of pack files kept open by the cachegetStats()
Returns a snapshot of this recorder's stats.long
Total time in nanoseconds the cache spent loading new values.void
recordEvictions
(int count) Record cache evictions due to the cache evictions strategyvoid
recordHits
(int count) Record cache hits.void
recordLoadFailure
(long loadTimeNanos) Record a failed load of a cache entryvoid
recordLoadSuccess
(long loadTimeNanos) Record a successful load of a cache entryvoid
recordMisses
(int count) Record cache misses.void
recordOpenBytes
(Pack pack, int delta) Record cached bytesvoid
recordOpenFiles
(int delta) Record files opened by cacheprivate static String
repositoryId
(Pack pack) void
Reset counters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jgit.storage.file.WindowCacheStats
getAverageLoadTime, getEvictionRatio, getHitRatio, getLoadCount, getLoadFailureRatio, getMissRatio, getRequestCount
-
Field Details
-
hitCount
-
missCount
-
loadSuccessCount
-
loadFailureCount
-
totalLoadTime
-
evictionCount
-
openFileCount
-
openByteCount
-
openByteCountPerRepository
-
-
Constructor Details
-
StatsRecorderImpl
public StatsRecorderImpl()Constructs an instance with all counts initialized to zero.
-
-
Method Details
-
recordHits
public void recordHits(int count) Description copied from interface:WindowCache.StatsRecorder
Record cache hits. Called when cache returns a cached entry.- Specified by:
recordHits
in interfaceWindowCache.StatsRecorder
- Parameters:
count
- number of cache hits to record
-
recordMisses
public void recordMisses(int count) Description copied from interface:WindowCache.StatsRecorder
Record cache misses. Called when the cache returns an entry which had to be loaded.- Specified by:
recordMisses
in interfaceWindowCache.StatsRecorder
- Parameters:
count
- number of cache misses to record
-
recordLoadSuccess
public void recordLoadSuccess(long loadTimeNanos) Description copied from interface:WindowCache.StatsRecorder
Record a successful load of a cache entry- Specified by:
recordLoadSuccess
in interfaceWindowCache.StatsRecorder
- Parameters:
loadTimeNanos
- time to load a cache entry
-
recordLoadFailure
public void recordLoadFailure(long loadTimeNanos) Description copied from interface:WindowCache.StatsRecorder
Record a failed load of a cache entry- Specified by:
recordLoadFailure
in interfaceWindowCache.StatsRecorder
- Parameters:
loadTimeNanos
- time used trying to load a cache entry
-
recordEvictions
public void recordEvictions(int count) Description copied from interface:WindowCache.StatsRecorder
Record cache evictions due to the cache evictions strategy- Specified by:
recordEvictions
in interfaceWindowCache.StatsRecorder
- Parameters:
count
- number of evictions to record
-
recordOpenFiles
public void recordOpenFiles(int delta) Description copied from interface:WindowCache.StatsRecorder
Record files opened by cache- Specified by:
recordOpenFiles
in interfaceWindowCache.StatsRecorder
- Parameters:
delta
- delta of number of files opened by cache
-
recordOpenBytes
Description copied from interface:WindowCache.StatsRecorder
Record cached bytes- Specified by:
recordOpenBytes
in interfaceWindowCache.StatsRecorder
- Parameters:
pack
- pack file the bytes are read fromdelta
- delta of cached bytes
-
repositoryId
-
getStats
Description copied from interface:WindowCache.StatsRecorder
Returns a snapshot of this recorder's stats. Note that this may be an inconsistent view, as it may be interleaved with update operations.- Specified by:
getStats
in interfaceWindowCache.StatsRecorder
- Returns:
- a snapshot of this recorder's stats
-
getHitCount
public long getHitCount()Description copied from interface:WindowCacheStats
Number of cache hits- Specified by:
getHitCount
in interfaceWindowCacheStats
- Returns:
- number of cache hits
-
getMissCount
public long getMissCount()Description copied from interface:WindowCacheStats
Number of cache misses.- Specified by:
getMissCount
in interfaceWindowCacheStats
- Returns:
- number of cash misses
-
getLoadSuccessCount
public long getLoadSuccessCount()Description copied from interface:WindowCacheStats
Number of successful loads- Specified by:
getLoadSuccessCount
in interfaceWindowCacheStats
- Returns:
- number of successful loads
-
getLoadFailureCount
public long getLoadFailureCount()Description copied from interface:WindowCacheStats
Number of failed loads- Specified by:
getLoadFailureCount
in interfaceWindowCacheStats
- Returns:
- number of failed loads
-
getEvictionCount
public long getEvictionCount()Description copied from interface:WindowCacheStats
Number of cache evictions- Specified by:
getEvictionCount
in interfaceWindowCacheStats
- Returns:
- number of evictions
-
getTotalLoadTime
public long getTotalLoadTime()Description copied from interface:WindowCacheStats
Total time in nanoseconds the cache spent loading new values.- Specified by:
getTotalLoadTime
in interfaceWindowCacheStats
- Returns:
- the total number of nanoseconds the cache has spent loading new values
-
getOpenFileCount
public long getOpenFileCount()Description copied from interface:WindowCacheStats
Number of pack files kept open by the cache- Specified by:
getOpenFileCount
in interfaceWindowCacheStats
- Returns:
- number of files kept open by cache
-
getOpenByteCount
public long getOpenByteCount()Description copied from interface:WindowCacheStats
Number of bytes cached- Specified by:
getOpenByteCount
in interfaceWindowCacheStats
- Returns:
- number of bytes cached
-
resetCounters
public void resetCounters()Description copied from interface:WindowCacheStats
Reset counters. Does not reset open bytes and open files counters.- Specified by:
resetCounters
in interfaceWindowCacheStats
-
getOpenByteCountPerRepository
Description copied from interface:WindowCacheStats
Number of bytes cached per repository- Specified by:
getOpenByteCountPerRepository
in interfaceWindowCacheStats
- Returns:
- number of bytes cached per repository
-