@Beta public static interface AbstractCache.StatsCounter
Cache for presentation by
Cache.stats() . This is solely intended for consumption by
Cache implementors.
| Modifier and Type | Method and Description |
|---|---|
void |
recordEviction()
Records the eviction of an entry from the cache.
|
void |
recordHits(int count)
Records cache hits.
|
void |
recordLoadException(long loadTime)
Records the failed load of a new entry.
|
void |
recordLoadSuccess(long loadTime)
Records the successful load of a new entry.
|
void |
recordMisses(int count)
Records cache misses.
|
CacheStats |
snapshot()
Returns a snapshot of this counter's values.
|
void recordHits(int count)
count - the number of hits to record
void recordMisses(int count)
Cache lookup methods with the same key on an absent value should result in a single call to either
recordLoadSuccess or
recordLoadException and multiple calls to this method, despite all being served by the results of a single load operation.
count - the number of misses to record
void recordLoadSuccess(long loadTime)
recordMisses(int), this method should only be called by the loading thread.
loadTime - the number of nanoseconds the cache spent computing or retrieving the new value
void recordLoadException(long loadTime)
recordMisses(int), this method should only be called by the loading thread.
loadTime - the number of nanoseconds the cache spent computing or retrieving the new value prior to an exception being thrown
void recordEviction()
CacheStatssnapshot()