Interface WindowCache.StatsRecorder
-
- All Known Implementing Classes:
WindowCache.StatsRecorderImpl
- Enclosing class:
- WindowCache
static interface WindowCache.StatsRecorder
Record statistics for a cache
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WindowCacheStats
getStats()
Returns a snapshot of this recorder's stats.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(PackFile pack, int delta)
Record cached bytesvoid
recordOpenFiles(int delta)
Record files opened by cache
-
-
-
Method Detail
-
recordHits
void recordHits(int count)
Record cache hits. Called when cache returns a cached entry.- Parameters:
count
- number of cache hits to record
-
recordMisses
void recordMisses(int count)
Record cache misses. Called when the cache returns an entry which had to be loaded.- Parameters:
count
- number of cache misses to record
-
recordLoadSuccess
void recordLoadSuccess(long loadTimeNanos)
Record a successful load of a cache entry- Parameters:
loadTimeNanos
- time to load a cache entry
-
recordLoadFailure
void recordLoadFailure(long loadTimeNanos)
Record a failed load of a cache entry- Parameters:
loadTimeNanos
- time used trying to load a cache entry
-
recordEvictions
void recordEvictions(int count)
Record cache evictions due to the cache evictions strategy- Parameters:
count
- number of evictions to record
-
recordOpenFiles
void recordOpenFiles(int delta)
Record files opened by cache- Parameters:
delta
- delta of number of files opened by cache
-
recordOpenBytes
void recordOpenBytes(PackFile pack, int delta)
Record cached bytes- Parameters:
pack
- pack file the bytes are read fromdelta
- delta of cached bytes
-
getStats
@NonNull WindowCacheStats getStats()
Returns a snapshot of this recorder's stats. Note that this may be an inconsistent view, as it may be interleaved with update operations.- Returns:
- a snapshot of this recorder's stats
-
-