Package org.apache.jackrabbit.oak.cache
Class AbstractCacheStats
- java.lang.Object
-
- javax.management.StandardMBean
-
- org.apache.jackrabbit.oak.commons.jmx.AnnotatedStandardMBean
-
- org.apache.jackrabbit.oak.cache.AbstractCacheStats
-
- All Implemented Interfaces:
javax.management.DynamicMBean
,javax.management.MBeanRegistration
,CacheStatsMBean
- Direct Known Subclasses:
CacheStats
@Deprecated(since="2022-12-01") public abstract class AbstractCacheStats extends AnnotatedStandardMBean implements CacheStatsMBean
Deprecated.The Jackrabbit Oak Cache library is designed for Oak-internal use only and thus deprecated. It will not be part of the AEM SDK after April 2023.Abstract base class for providing cache statistic via theCacheStatsMBean
.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean
TYPE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
cacheInfoAsString()
Deprecated.Gathers the stats of the cache for logging.double
getAverageLoadPenalty()
Deprecated.Returns the average time spent loading new values.long
getEvictionCount()
Deprecated.Returns the number of times an entry has been evicted.long
getHitCount()
Deprecated.Returns the number of timescom.google.common.cache.Cache
lookup methods have returned a cached value.double
getHitRate()
Deprecated.Returns the ratio of cache requests which were hits.long
getLoadCount()
Deprecated.Returns the total number of times thatcom.google.common.cache.Cache
lookup methods attempted to load new values.long
getLoadExceptionCount()
Deprecated.Returns the number of timescom.google.common.cache.Cache
lookup methods threw an exception while loading a new value.double
getLoadExceptionRate()
Deprecated.Returns the ratio of cache loading attempts which threw exceptions.long
getLoadSuccessCount()
Deprecated.Returns the number of timescom.google.common.cache.Cache
lookup methods have successfully loaded a new value.long
getMissCount()
Deprecated.Returns the number of timescom.google.common.cache.Cache
lookup methods have returned an uncached (newly loaded) value, or null.double
getMissRate()
Deprecated.Returns the ratio of cache requests which were misses.@NotNull java.lang.String
getName()
Deprecated.long
getRequestCount()
Deprecated.Returns the number of timescom.google.common.cache.Cache
lookup methods have returned either a cached or uncached value.long
getTotalLoadTime()
Deprecated.Returns the total number of nanoseconds the cache has spent loading new values.void
resetStats()
Deprecated.Reset the cache statsstatic java.lang.String
timeInWords(long nanos)
Deprecated.-
Methods inherited from class javax.management.StandardMBean
getAttribute, getAttributes, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean
estimateCurrentWeight, getElementCount, getMaxTotalWeight
-
-
-
-
Method Detail
-
resetStats
public void resetStats()
Deprecated.Description copied from interface:CacheStatsMBean
Reset the cache stats- Specified by:
resetStats
in interfaceCacheStatsMBean
-
getName
@NotNull public @NotNull java.lang.String getName()
Deprecated.- Specified by:
getName
in interfaceCacheStatsMBean
-
getRequestCount
public long getRequestCount()
Deprecated.Description copied from interface:CacheStatsMBean
Returns the number of timescom.google.common.cache.Cache
lookup methods have returned either a cached or uncached value. This is defined asgetHitCount + getMissCount
.- Specified by:
getRequestCount
in interfaceCacheStatsMBean
-
getHitCount
public long getHitCount()
Deprecated.Description copied from interface:CacheStatsMBean
Returns the number of timescom.google.common.cache.Cache
lookup methods have returned a cached value.- Specified by:
getHitCount
in interfaceCacheStatsMBean
-
getHitRate
public double getHitRate()
Deprecated.Description copied from interface:CacheStatsMBean
Returns the ratio of cache requests which were hits. This is defined asgetHitCount / getRequestCount
, or1.0
whengetRequestCount == 0
. Note thatgetHitRate + getMissRate =~ 1.0
.- Specified by:
getHitRate
in interfaceCacheStatsMBean
-
getMissCount
public long getMissCount()
Deprecated.Description copied from interface:CacheStatsMBean
Returns the number of timescom.google.common.cache.Cache
lookup methods have returned an uncached (newly loaded) value, or null. Multiple concurrent calls tocom.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.- Specified by:
getMissCount
in interfaceCacheStatsMBean
-
getMissRate
public double getMissRate()
Deprecated.Description copied from interface:CacheStatsMBean
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.- Specified by:
getMissRate
in interfaceCacheStatsMBean
-
getLoadCount
public long getLoadCount()
Deprecated.Description copied from interface:CacheStatsMBean
Returns the total number of times thatcom.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 asgetLoadSuccessCount + getLoadExceptionCount
.- Specified by:
getLoadCount
in interfaceCacheStatsMBean
-
getLoadSuccessCount
public long getLoadSuccessCount()
Deprecated.Description copied from interface:CacheStatsMBean
Returns the number of timescom.google.common.cache.Cache
lookup methods have successfully loaded a new value. This is always incremented in conjunction withCacheStatsMBean.getMissCount()
, thoughgetMissCount
is also incremented when an exception is encountered during cache loading (seeCacheStatsMBean.getLoadExceptionCount()
). Multiple concurrent misses for the same key will result in a single load operation.- Specified by:
getLoadSuccessCount
in interfaceCacheStatsMBean
-
getLoadExceptionCount
public long getLoadExceptionCount()
Deprecated.Description copied from interface:CacheStatsMBean
Returns the number of timescom.google.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 (seeCacheStatsMBean.getLoadSuccessCount()
). Multiple concurrent misses for the same key will result in a single load operation.- Specified by:
getLoadExceptionCount
in interfaceCacheStatsMBean
-
getLoadExceptionRate
public double getLoadExceptionRate()
Deprecated.Description copied from interface:CacheStatsMBean
Returns the ratio of cache loading attempts which threw exceptions. This is defined asgetLoadExceptionCount / (getLoadSuccessCount + getLoadExceptionCount)
, or0.0
whengetLoadSuccessCount + getLoadExceptionCount == 0
.- Specified by:
getLoadExceptionRate
in interfaceCacheStatsMBean
-
getTotalLoadTime
public long getTotalLoadTime()
Deprecated.Description copied from interface:CacheStatsMBean
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.- Specified by:
getTotalLoadTime
in interfaceCacheStatsMBean
-
getAverageLoadPenalty
public double getAverageLoadPenalty()
Deprecated.Description copied from interface:CacheStatsMBean
Returns the average time spent loading new values. This is defined asgetTotalLoadTime / (getLoadSuccessCount + getLoadExceptionCount)
.- Specified by:
getAverageLoadPenalty
in interfaceCacheStatsMBean
-
getEvictionCount
public long getEvictionCount()
Deprecated.Description copied from interface:CacheStatsMBean
Returns the number of times an entry has been evicted. This count does not include manualcom.google.common.cache.Cache#invalidate invalidations
.- Specified by:
getEvictionCount
in interfaceCacheStatsMBean
-
cacheInfoAsString
public java.lang.String cacheInfoAsString()
Deprecated.Description copied from interface:CacheStatsMBean
Gathers the stats of the cache for logging.- Specified by:
cacheInfoAsString
in interfaceCacheStatsMBean
-
timeInWords
public static java.lang.String timeInWords(long nanos)
Deprecated.
-
-