public class CacheStats extends AbstractCacheStats
TYPE
Constructor and Description |
---|
CacheStats(@NotNull Cache<?,?> cache,
@NotNull String name,
@Nullable Weigher<?,?> weigher,
long maxWeight)
Construct the cache stats object.
|
Modifier and Type | Method and Description |
---|---|
long |
estimateCurrentWeight()
Total weight of the complete cache.
|
protected CacheStats |
getCurrentStats()
Call back invoked to retrieve the most recent
CacheStats instance of the
underlying cache. |
long |
getElementCount()
Get the number of elements/objects in the cache.
|
long |
getMaxTotalWeight()
The maximum weight of entries the cache may contain.
|
cacheInfoAsString, getAverageLoadPenalty, getEvictionCount, getHitCount, getHitRate, getLoadCount, getLoadExceptionCount, getLoadExceptionRate, getLoadSuccessCount, getMissCount, getMissRate, getName, getRequestCount, getTotalLoadTime, resetStats, timeInWords
getDescription, getDescription, getDescription, getDescription, getImpact, getParameterName
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
public CacheStats(@NotNull @NotNull Cache<?,?> cache, @NotNull @NotNull String name, @Nullable @Nullable Weigher<?,?> weigher, long maxWeight)
cache
- the cachename
- the name of the cacheweigher
- the weigher used to estimate the current weightmaxWeight
- the maximum weightprotected CacheStats getCurrentStats()
AbstractCacheStats
CacheStats
instance of the
underlying cache.getCurrentStats
in class AbstractCacheStats
public long getElementCount()
CacheStatsMBean
public long estimateCurrentWeight()
CacheStatsMBean
public long getMaxTotalWeight()
CacheStatsMBean
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.