Interface CacheStatsMBean
- All Known Subinterfaces:
DataStoreCacheStatsMBean
,PersistentCacheStatsMBean
- All Known Implementing Classes:
AbstractCacheStats
,CacheStats
,CacheStatsMBeanWrapper
,PersistentCacheStats
,RecordCacheStats
,SegmentCacheStats
@ProviderType
public interface CacheStatsMBean
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGathers the stats of the cache for logging.long
Total weight of the complete cache.double
Returns the average time spent loading new values.long
Get the number of elements/objects in the cache.long
Returns the number of times an entry has been evicted.long
Returns the number of timesorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods have returned a cached value.double
Returns the ratio of cache requests which were hits.long
Returns the total number of times thatorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods attempted to load new values.long
Returns the number of timesorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods threw an exception while loading a new value.double
Returns the ratio of cache loading attempts which threw exceptions.long
Returns the number of timesorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods have successfully loaded a new value.long
The maximum weight of entries the cache may contain.long
Returns the number of timesorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods have returned an uncached (newly loaded) value, or null.double
Returns the ratio of cache requests which were misses.getName()
long
Returns the number of timesorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods have returned either a cached or uncached value.long
Returns the total number of nanoseconds the cache has spent loading new values.void
Reset the cache stats
-
Field Details
-
TYPE
- See Also:
-
-
Method Details
-
getName
String getName() -
getRequestCount
long getRequestCount()Returns the number of timesorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods have returned either a cached or uncached value. This is defined asgetHitCount + getMissCount
. -
getHitCount
long getHitCount()Returns the number of timesorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods have returned a cached value. -
getHitRate
double getHitRate()Returns the ratio of cache requests which were hits. This is defined asgetHitCount / getRequestCount
, or1.0
whengetRequestCount == 0
. Note thatgetHitRate + getMissRate =~ 1.0
. -
getMissCount
long getMissCount()Returns the number of timesorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods have returned an uncached (newly loaded) value, or null. Multiple concurrent calls toorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods on an absent value can result in multiple misses, all returning the results of a single cache load operation. -
getMissRate
double getMissRate()Returns the ratio of cache requests which were misses. This is defined asgetMissCount / getRequestCount
, or0.0
whengetRequestCount == 0
. Note thatgetHitRate + 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 thatgetMissCount >= getLoadSuccessCount + getLoadExceptionCount
. Multiple concurrent misses for the same key will result in a single load operation. -
getLoadCount
long getLoadCount()Returns the total number of times thatorg.apache.jackrabbit.guava.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 asgetLoadSuccessCount + getLoadExceptionCount
. -
getLoadSuccessCount
long getLoadSuccessCount()Returns the number of timesorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods have successfully loaded a new value. This is always 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. -
getLoadExceptionCount
long getLoadExceptionCount()Returns the number of timesorg.apache.jackrabbit.guava.common.cache.Cache
lookup methods threw an exception while loading a new value. This is always 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. -
getLoadExceptionRate
double getLoadExceptionRate()Returns the ratio of cache loading attempts which threw exceptions. This is defined asgetLoadExceptionCount / (getLoadSuccessCount + getLoadExceptionCount)
, or0.0
whengetLoadSuccessCount + getLoadExceptionCount == 0
. -
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. -
getAverageLoadPenalty
double getAverageLoadPenalty()Returns the average time spent loading new values. This is defined asgetTotalLoadTime / (getLoadSuccessCount + getLoadExceptionCount)
. -
getEvictionCount
long getEvictionCount()Returns the number of times an entry has been evicted. This count does not include manualorg.apache.jackrabbit.guava.common.cache.Cache#invalidate invalidations
. -
getElementCount
long getElementCount()Get the number of elements/objects in the cache.- Returns:
- the number of elements
-
getMaxTotalWeight
long getMaxTotalWeight()The maximum weight of entries the cache may contain.- Returns:
- the maximum total weight of entries the cache may contain
-
estimateCurrentWeight
long estimateCurrentWeight()Total weight of the complete cache. Depending on implementation it might be the amount of RAM taken by the cache- Returns:
- to weight of the cache
-
cacheInfoAsString
String cacheInfoAsString()Gathers the stats of the cache for logging. -
resetStats
void resetStats()Reset the cache stats
-