public abstract class AbstractCacheStats extends AnnotatedStandardMBean implements CacheStatsMBean
CacheStatsMBean.TYPE| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
cacheInfoAsString()
Gathers the stats of the cache for logging.
|
double |
getAverageLoadPenalty()
Returns the average time spent loading new values.
|
long |
getEvictionCount()
Returns the number of times an entry has been evicted.
|
long |
getHitCount()
Returns the number of times
com.google.common.cache.Cache lookup methods have returned a cached value. |
double |
getHitRate()
Returns the ratio of cache requests which were hits.
|
long |
getLoadCount()
Returns the total number of times that
com.google.common.cache.Cache lookup methods attempted to load new
values. |
long |
getLoadExceptionCount()
Returns the number of times
com.google.common.cache.Cache lookup methods threw an exception while loading a
new value. |
double |
getLoadExceptionRate()
Returns the ratio of cache loading attempts which threw exceptions.
|
long |
getLoadSuccessCount()
Returns the number of times
com.google.common.cache.Cache lookup methods have successfully loaded a new value. |
long |
getMissCount()
Returns the number of times
com.google.common.cache.Cache lookup methods have returned an uncached (newly
loaded) value, or null. |
double |
getMissRate()
Returns the ratio of cache requests which were misses.
|
@NotNull java.lang.String |
getName() |
long |
getRequestCount()
Returns the number of times
com.google.common.cache.Cache lookup methods have returned either a cached or
uncached value. |
long |
getTotalLoadTime()
Returns the total number of nanoseconds the cache has spent loading new values.
|
void |
resetStats()
Reset the cache stats
|
static java.lang.String |
timeInWords(long nanos) |
getAttribute, getAttributes, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementationequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitestimateCurrentWeight, getElementCount, getMaxTotalWeightpublic void resetStats()
CacheStatsMBeanresetStats in interface CacheStatsMBean@NotNull public @NotNull java.lang.String getName()
getName in interface CacheStatsMBeanpublic long getRequestCount()
CacheStatsMBeancom.google.common.cache.Cache lookup methods have returned either a cached or
uncached value. This is defined as getHitCount + getMissCount.getRequestCount in interface CacheStatsMBeanpublic long getHitCount()
CacheStatsMBeancom.google.common.cache.Cache lookup methods have returned a cached value.getHitCount in interface CacheStatsMBeanpublic double getHitRate()
CacheStatsMBeangetHitCount / getRequestCount, or 1.0 when getRequestCount == 0.
Note that getHitRate + getMissRate =~ 1.0.getHitRate in interface CacheStatsMBeanpublic long getMissCount()
CacheStatsMBeancom.google.common.cache.Cache lookup methods have returned an uncached (newly
loaded) value, or null. Multiple concurrent calls to com.google.common.cache.Cache lookup methods on an absent
value can result in multiple misses, all returning the results of a single cache load
operation.getMissCount in interface CacheStatsMBeanpublic double getMissRate()
CacheStatsMBeangetMissCount / getRequestCount, or 0.0 when getRequestCount == 0.
Note that getHitRate + getMissRate =~ 1.0. Cache misses include all requests which
weren't cache hits, including requests which resulted in either successful or failed loading
attempts, and requests which waited for other threads to finish loading. It is thus the case
that getMissCount >= getLoadSuccessCount + getLoadExceptionCount. Multiple
concurrent misses for the same key will result in a single load operation.getMissRate in interface CacheStatsMBeanpublic long getLoadCount()
CacheStatsMBeancom.google.common.cache.Cache lookup methods attempted to load new
values. This includes both successful load operations, as well as those that threw
exceptions. This is defined as getLoadSuccessCount + getLoadExceptionCount.getLoadCount in interface CacheStatsMBeanpublic long getLoadSuccessCount()
CacheStatsMBeancom.google.common.cache.Cache lookup methods have successfully loaded a new value.
This is always incremented in conjunction with CacheStatsMBean.getMissCount(), though getMissCount
is also incremented when an exception is encountered during cache loading (see
CacheStatsMBean.getLoadExceptionCount()). Multiple concurrent misses for the same key will result in a
single load operation.getLoadSuccessCount in interface CacheStatsMBeanpublic long getLoadExceptionCount()
CacheStatsMBeancom.google.common.cache.Cache lookup methods threw an exception while loading a
new value. This is always incremented in conjunction with getMissCount, though
getMissCount is also incremented when cache loading completes successfully (see
CacheStatsMBean.getLoadSuccessCount()). Multiple concurrent misses for the same key will result in a
single load operation.getLoadExceptionCount in interface CacheStatsMBeanpublic double getLoadExceptionRate()
CacheStatsMBeangetLoadExceptionCount / (getLoadSuccessCount + getLoadExceptionCount), or
0.0 when getLoadSuccessCount + getLoadExceptionCount == 0.getLoadExceptionRate in interface CacheStatsMBeanpublic long getTotalLoadTime()
CacheStatsMBeangetLoadSuccessCount or getLoadExceptionCount is incremented.getTotalLoadTime in interface CacheStatsMBeanpublic double getAverageLoadPenalty()
CacheStatsMBeangetTotalLoadTime / (getLoadSuccessCount + getLoadExceptionCount).getAverageLoadPenalty in interface CacheStatsMBeanpublic long getEvictionCount()
CacheStatsMBeancom.google.common.cache.Cache#invalidate invalidations.getEvictionCount in interface CacheStatsMBeanpublic java.lang.String cacheInfoAsString()
CacheStatsMBeancacheInfoAsString in interface CacheStatsMBeanpublic static java.lang.String timeInWords(long nanos)
Copyright © 2010 - 2023 Adobe. All Rights Reserved