public class DefaultCacheStatistics extends java.lang.Object implements CacheStatistics
Constructor and Description |
---|
DefaultCacheStatistics(InternalCache<?,?> cache) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Reset the values for this cache and its underlying tiers.
|
long |
getCacheEvictions()
How many evictions occurred on the cache since its creation or the latest
CacheStatistics.clear() |
long |
getCacheExpirations()
How many expirations occurred on the cache since its creation or the latest
CacheStatistics.clear() |
long |
getCacheGets()
How many gets occurred on the cache since its creation or the latest
CacheStatistics.clear() |
float |
getCacheHitPercentage()
The percentage of hits compared to all gets since the cache creation or the latest
CacheStatistics.clear() |
long |
getCacheHits()
How many hits occurred on the cache since its creation or the latest
CacheStatistics.clear() |
long |
getCacheMisses()
How many misses occurred on the cache since its creation or the latest
CacheStatistics.clear() |
float |
getCacheMissPercentage()
The percentage of misses compared to all gets since the cache creation or the latest
CacheStatistics.clear() |
long |
getCachePuts()
How many puts occurred on the cache since its creation or the latest
CacheStatistics.clear() |
long |
getCacheRemovals()
How many removals occurred on the cache since its creation or the latest
CacheStatistics.clear() |
java.util.Map<java.lang.String,<any>> |
getKnownStatistics() |
java.util.Map<java.lang.String,TierStatistics> |
getTierStatistics()
Map of tier statistics on this cache.
|
<T extends java.lang.Enum<T>,S extends ChainedOperationObserver<? super T>> |
registerDerivedStatistic(java.lang.Class<T> outcomeClass,
java.lang.String statName,
S derivedStatistic)
Register a derived statistic to one of the existing statistic.
|
public DefaultCacheStatistics(InternalCache<?,?> cache)
public <T extends java.lang.Enum<T>,S extends ChainedOperationObserver<? super T>> void registerDerivedStatistic(java.lang.Class<T> outcomeClass, java.lang.String statName, S derivedStatistic)
CacheStatistics
registerDerivedStatistic
in interface CacheStatistics
T
- type of the outcomeS
- type of the derived statisticoutcomeClass
- the enum of the possible outcomesstatName
- name of the statistic we are looking forderivedStatistic
- derived statistic to registerpublic java.util.Map<java.lang.String,<any>> getKnownStatistics()
public java.util.Map<java.lang.String,TierStatistics> getTierStatistics()
CacheStatistics
getTierStatistics
in interface CacheStatistics
public void clear()
CacheStatistics
Implementation note: Calling clear doesn't really clear the data. It freezes the actual values and compensate for them when returning a result.
clear
in interface CacheStatistics
public long getCacheHits()
CacheStatistics
CacheStatistics.clear()
getCacheHits
in interface CacheStatistics
public float getCacheHitPercentage()
CacheStatistics
CacheStatistics.clear()
getCacheHitPercentage
in interface CacheStatistics
public long getCacheMisses()
CacheStatistics
CacheStatistics.clear()
getCacheMisses
in interface CacheStatistics
public float getCacheMissPercentage()
CacheStatistics
CacheStatistics.clear()
getCacheMissPercentage
in interface CacheStatistics
public long getCacheGets()
CacheStatistics
CacheStatistics.clear()
getCacheGets
in interface CacheStatistics
public long getCachePuts()
CacheStatistics
CacheStatistics.clear()
getCachePuts
in interface CacheStatistics
public long getCacheRemovals()
CacheStatistics
CacheStatistics.clear()
getCacheRemovals
in interface CacheStatistics
public long getCacheEvictions()
CacheStatistics
CacheStatistics.clear()
getCacheEvictions
in interface CacheStatistics
public long getCacheExpirations()
CacheStatistics
CacheStatistics.clear()
getCacheExpirations
in interface CacheStatistics