Interface WindowCache.StatsRecorder
- All Known Implementing Classes:
WindowCache.StatsRecorderImpl
- Enclosing class:
- WindowCache
static interface WindowCache.StatsRecorder
Record statistics for a cache
-
Method Summary
Modifier and TypeMethodDescriptiongetStats()Returns a snapshot of this recorder's stats.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 cache
-
Method Details
-
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
Record cached bytes- Parameters:
pack- pack file the bytes are read fromdelta- delta of cached bytes
-
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
-