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 TypeMethodDescriptionlongNumber of cache evictionslongNumber of cache hitslongNumber of failed loadslongNumber of successful loadslongNumber of cache misses.longNumber of bytes cachedNumber of bytes cached per repositorylongNumber of pack files kept open by the cachegetStats()Returns a snapshot of this recorder's stats.longTotal time in nanoseconds the cache spent loading new values.voidrecordEvictions(int count) Record cache evictions due to the cache evictions strategyvoidrecordHits(int count) Record cache hits.voidrecordLoadFailure(long loadTimeNanos) Record a failed load of a cache entryvoidrecordLoadSuccess(long loadTimeNanos) Record a successful load of a cache entryvoidrecordMisses(int count) Record cache misses.voidrecordOpenBytes(Pack pack, int delta) Record cached bytesvoidrecordOpenFiles(int delta) Record files opened by cacheprivate static StringrepositoryId(Pack pack) voidReset counters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.StatsRecorderRecord cache hits. Called when cache returns a cached entry.- Specified by:
recordHitsin interfaceWindowCache.StatsRecorder- Parameters:
count- number of cache hits to record
-
recordMisses
public void recordMisses(int count) Description copied from interface:WindowCache.StatsRecorderRecord cache misses. Called when the cache returns an entry which had to be loaded.- Specified by:
recordMissesin interfaceWindowCache.StatsRecorder- Parameters:
count- number of cache misses to record
-
recordLoadSuccess
public void recordLoadSuccess(long loadTimeNanos) Description copied from interface:WindowCache.StatsRecorderRecord a successful load of a cache entry- Specified by:
recordLoadSuccessin interfaceWindowCache.StatsRecorder- Parameters:
loadTimeNanos- time to load a cache entry
-
recordLoadFailure
public void recordLoadFailure(long loadTimeNanos) Description copied from interface:WindowCache.StatsRecorderRecord a failed load of a cache entry- Specified by:
recordLoadFailurein interfaceWindowCache.StatsRecorder- Parameters:
loadTimeNanos- time used trying to load a cache entry
-
recordEvictions
public void recordEvictions(int count) Description copied from interface:WindowCache.StatsRecorderRecord cache evictions due to the cache evictions strategy- Specified by:
recordEvictionsin interfaceWindowCache.StatsRecorder- Parameters:
count- number of evictions to record
-
recordOpenFiles
public void recordOpenFiles(int delta) Description copied from interface:WindowCache.StatsRecorderRecord files opened by cache- Specified by:
recordOpenFilesin interfaceWindowCache.StatsRecorder- Parameters:
delta- delta of number of files opened by cache
-
recordOpenBytes
Description copied from interface:WindowCache.StatsRecorderRecord cached bytes- Specified by:
recordOpenBytesin interfaceWindowCache.StatsRecorder- Parameters:
pack- pack file the bytes are read fromdelta- delta of cached bytes
-
repositoryId
-
getStats
Description copied from interface:WindowCache.StatsRecorderReturns 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:
getStatsin interfaceWindowCache.StatsRecorder- Returns:
- a snapshot of this recorder's stats
-
getHitCount
public long getHitCount()Description copied from interface:WindowCacheStatsNumber of cache hits- Specified by:
getHitCountin interfaceWindowCacheStats- Returns:
- number of cache hits
-
getMissCount
public long getMissCount()Description copied from interface:WindowCacheStatsNumber of cache misses.- Specified by:
getMissCountin interfaceWindowCacheStats- Returns:
- number of cash misses
-
getLoadSuccessCount
public long getLoadSuccessCount()Description copied from interface:WindowCacheStatsNumber of successful loads- Specified by:
getLoadSuccessCountin interfaceWindowCacheStats- Returns:
- number of successful loads
-
getLoadFailureCount
public long getLoadFailureCount()Description copied from interface:WindowCacheStatsNumber of failed loads- Specified by:
getLoadFailureCountin interfaceWindowCacheStats- Returns:
- number of failed loads
-
getEvictionCount
public long getEvictionCount()Description copied from interface:WindowCacheStatsNumber of cache evictions- Specified by:
getEvictionCountin interfaceWindowCacheStats- Returns:
- number of evictions
-
getTotalLoadTime
public long getTotalLoadTime()Description copied from interface:WindowCacheStatsTotal time in nanoseconds the cache spent loading new values.- Specified by:
getTotalLoadTimein interfaceWindowCacheStats- Returns:
- the total number of nanoseconds the cache has spent loading new values
-
getOpenFileCount
public long getOpenFileCount()Description copied from interface:WindowCacheStatsNumber of pack files kept open by the cache- Specified by:
getOpenFileCountin interfaceWindowCacheStats- Returns:
- number of files kept open by cache
-
getOpenByteCount
public long getOpenByteCount()Description copied from interface:WindowCacheStatsNumber of bytes cached- Specified by:
getOpenByteCountin interfaceWindowCacheStats- Returns:
- number of bytes cached
-
resetCounters
public void resetCounters()Description copied from interface:WindowCacheStatsReset counters. Does not reset open bytes and open files counters.- Specified by:
resetCountersin interfaceWindowCacheStats
-
getOpenByteCountPerRepository
Description copied from interface:WindowCacheStatsNumber of bytes cached per repository- Specified by:
getOpenByteCountPerRepositoryin interfaceWindowCacheStats- Returns:
- number of bytes cached per repository
-