static class WindowCache.StatsRecorderImpl extends java.lang.Object implements WindowCache.StatsRecorder, WindowCacheStats
| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.atomic.LongAdder |
evictionCount |
private java.util.concurrent.atomic.LongAdder |
hitCount |
private java.util.concurrent.atomic.LongAdder |
loadFailureCount |
private java.util.concurrent.atomic.LongAdder |
loadSuccessCount |
private java.util.concurrent.atomic.LongAdder |
missCount |
private java.util.concurrent.atomic.LongAdder |
openByteCount |
private java.util.Map<java.lang.String,java.util.concurrent.atomic.LongAdder> |
openByteCountPerRepository |
private java.util.concurrent.atomic.LongAdder |
openFileCount |
private java.util.concurrent.atomic.LongAdder |
totalLoadTime |
| Constructor and Description |
|---|
StatsRecorderImpl()
Constructs an instance with all counts initialized to zero.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getEvictionCount()
Number of cache evictions
|
long |
getHitCount()
Number of cache hits
|
long |
getLoadFailureCount()
Number of failed loads
|
long |
getLoadSuccessCount()
Number of successful loads
|
long |
getMissCount()
Number of cache misses.
|
long |
getOpenByteCount()
Number of bytes cached
|
java.util.Map<java.lang.String,java.lang.Long> |
getOpenByteCountPerRepository()
Number of bytes cached per repository
|
long |
getOpenFileCount()
Number of pack files kept open by the cache
|
WindowCacheStats |
getStats()
Returns a snapshot of this recorder's stats.
|
long |
getTotalLoadTime()
Total time in nanoseconds the cache spent loading new values.
|
void |
recordEvictions(int count)
Record cache evictions due to the cache evictions strategy
|
void |
recordHits(int count)
Record cache hits.
|
void |
recordLoadFailure(long loadTimeNanos)
Record a failed load of a cache entry
|
void |
recordLoadSuccess(long loadTimeNanos)
Record a successful load of a cache entry
|
void |
recordMisses(int count)
Record cache misses.
|
void |
recordOpenBytes(PackFile pack,
int delta)
Record cached bytes
|
void |
recordOpenFiles(int delta)
Record files opened by cache
|
private static java.lang.String |
repositoryId(PackFile pack) |
void |
resetCounters()
Reset counters.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAverageLoadTime, getEvictionRatio, getHitRatio, getLoadCount, getLoadFailureRatio, getMissRatio, getOpenBytes, getOpenFiles, getRequestCount, getStatsprivate final java.util.concurrent.atomic.LongAdder hitCount
private final java.util.concurrent.atomic.LongAdder missCount
private final java.util.concurrent.atomic.LongAdder loadSuccessCount
private final java.util.concurrent.atomic.LongAdder loadFailureCount
private final java.util.concurrent.atomic.LongAdder totalLoadTime
private final java.util.concurrent.atomic.LongAdder evictionCount
private final java.util.concurrent.atomic.LongAdder openFileCount
private final java.util.concurrent.atomic.LongAdder openByteCount
private final java.util.Map<java.lang.String,java.util.concurrent.atomic.LongAdder> openByteCountPerRepository
public StatsRecorderImpl()
public void recordHits(int count)
WindowCache.StatsRecorderrecordHits in interface WindowCache.StatsRecordercount - number of cache hits to recordpublic void recordMisses(int count)
WindowCache.StatsRecorderrecordMisses in interface WindowCache.StatsRecordercount - number of cache misses to recordpublic void recordLoadSuccess(long loadTimeNanos)
WindowCache.StatsRecorderrecordLoadSuccess in interface WindowCache.StatsRecorderloadTimeNanos - time to load a cache entrypublic void recordLoadFailure(long loadTimeNanos)
WindowCache.StatsRecorderrecordLoadFailure in interface WindowCache.StatsRecorderloadTimeNanos - time used trying to load a cache entrypublic void recordEvictions(int count)
WindowCache.StatsRecorderrecordEvictions in interface WindowCache.StatsRecordercount - number of evictions to recordpublic void recordOpenFiles(int delta)
WindowCache.StatsRecorderrecordOpenFiles in interface WindowCache.StatsRecorderdelta - delta of number of files opened by cachepublic void recordOpenBytes(PackFile pack, int delta)
WindowCache.StatsRecorderrecordOpenBytes in interface WindowCache.StatsRecorderpack - pack file the bytes are read fromdelta - delta of cached bytesprivate static java.lang.String repositoryId(PackFile pack)
public WindowCacheStats getStats()
WindowCache.StatsRecordergetStats in interface WindowCache.StatsRecorderpublic long getHitCount()
WindowCacheStatsgetHitCount in interface WindowCacheStatspublic long getMissCount()
WindowCacheStatsgetMissCount in interface WindowCacheStatspublic long getLoadSuccessCount()
WindowCacheStatsgetLoadSuccessCount in interface WindowCacheStatspublic long getLoadFailureCount()
WindowCacheStatsgetLoadFailureCount in interface WindowCacheStatspublic long getEvictionCount()
WindowCacheStatsgetEvictionCount in interface WindowCacheStatspublic long getTotalLoadTime()
WindowCacheStatsgetTotalLoadTime in interface WindowCacheStatspublic long getOpenFileCount()
WindowCacheStatsgetOpenFileCount in interface WindowCacheStatspublic long getOpenByteCount()
WindowCacheStatsgetOpenByteCount in interface WindowCacheStatspublic void resetCounters()
WindowCacheStatsresetCounters in interface WindowCacheStatspublic java.util.Map<java.lang.String,java.lang.Long> getOpenByteCountPerRepository()
WindowCacheStatsgetOpenByteCountPerRepository in interface WindowCacheStats