Interface CacheStatsMXBean
- All Known Implementing Classes:
CacheStats
public interface CacheStatsMXBean
JMX wrapper interface for the Guava
CacheStats
.-
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the number of times an entry has been evicted.long
Returns the number of timesCache
lookup methods have returned a cached value.long
Returns the number of timesCache
lookup methods threw an exception while loading a new value.long
Returns the number of timesCache
lookup methods have successfully loaded a new value.long
Returns the number of timesCache
lookup methods have returned an uncached (newly loaded) value, or null.long
Returns the total number of nanoseconds the cache has spent loading new values.
-
Method Details
-
getHitCount
long getHitCount()Returns the number of timesCache
lookup methods have returned a cached value.- Returns:
- The number of successful cache lookups.
- See Also:
-
CacheStats.hitCount()
-
getMissCount
long getMissCount()Returns the number of timesCache
lookup methods have returned an uncached (newly loaded) value, or null. Multiple concurrent calls toCache
lookup methods on an absent value can result in multiple misses, all returning the results of a single cache load operation.- Returns:
- The number of cache lookup misses.
- See Also:
-
CacheStats.missCount()
-
getLoadSuccessCount
long getLoadSuccessCount()Returns the number of timesCache
lookup methods have successfully loaded a new value. This is usually incremented in conjunction withgetMissCount()
, thoughgetMissCount
is also incremented when an exception is encountered during cache loading (seegetLoadExceptionCount()
). Multiple concurrent misses for the same key will result in a single load operation. This may be incremented not in conjunction withgetMissCount
if the load occurs as a result of a refresh or if the cache loader returned more items than was requested.getMissCount
may also be incremented not in conjunction with this (norgetLoadExceptionCount()
) on calls togetIfPresent
.- Returns:
- The number of successful loads of new cache entries.
- See Also:
-
CacheStats.loadSuccessCount()
-
getLoadExceptionCount
long getLoadExceptionCount()Returns the number of timesCache
lookup methods threw an exception while loading a new value. This is usually incremented in conjunction withgetMissCount
, thoughgetMissCount
is also incremented when cache loading completes successfully (seegetLoadSuccessCount()
). Multiple concurrent misses for the same key will result in a single load operation. This may be incremented not in conjunction withgetMissCount
if the load occurs as a result of a refresh or if the cache loader returned more items than was requested.getMissCount
may also be incremented not in conjunction with this (norgetLoadSuccessCount()
) on calls togetIfPresent
.- Returns:
- The number of exception during the load of new cache entries.
- See Also:
-
CacheStats.loadExceptionCount()
-
getTotalLoadTime
long getTotalLoadTime()Returns the total number of nanoseconds the cache has spent loading new values. This can be used to calculate the miss penalty. This value is increased every timegetLoadSuccessCount
orgetLoadExceptionCount
is incremented.- Returns:
- The total time spent loading new values, in nanoseconds.
- See Also:
-
CacheStats.totalLoadTime()
-
getEvictionCount
long getEvictionCount()Returns the number of times an entry has been evicted. This count does not include manual invalidations.- Returns:
- The number of automatic eviction of entries.
- See Also:
-
CacheStats.evictionCount()
-