Class GuavaCacheStats
java.lang.Object
org.ametys.plugins.core.impl.cache.GuavaCacheStats
- All Implemented Interfaces:
CacheStats
Guava implementation of CacheStats
-
Constructor Summary
ConstructorDescriptionGuavaCacheStats implementation of CacheStatsGuavaCacheStats
(CacheStats cacheStats) GuavaCacheStats implementation of CacheStats -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the number of times an entry has been evicted.double
Returns the ratio of cache requests that lead to an eviction.long
hitCount()
Returns the number of times cache lookup methods have returned a cached value.double
hitRate()
Returns the ratio of cache requests which were hits.minus
(CacheStats cacheStats) Returns a new CacheStats representing the difference between this CacheStats and other.long
Returns the number of times cache lookup methods have returned an uncached (newly loaded) value, or null.double
missRate()
Returns the ratio of cache requests which were misses.plus
(CacheStats cacheStats) Returns a new CacheStats representing the sum between this CacheStats and otherlong
Returns the number of times cache lookup methods have returned either a cached or uncached value.
-
Constructor Details
-
GuavaCacheStats
public GuavaCacheStats()GuavaCacheStats implementation of CacheStats -
GuavaCacheStats
GuavaCacheStats implementation of CacheStats- Parameters:
cacheStats
- stats of Guava cache
-
-
Method Details
-
requestCount
Description copied from interface:CacheStats
Returns the number of times cache lookup methods have returned either a cached or uncached value. This is defined as hitCount + missCount.- Specified by:
requestCount
in interfaceCacheStats
- Returns:
- the number of times cache lookup methods have returned either a cached or uncached value.
-
hitCount
Description copied from interface:CacheStats
Returns the number of times cache lookup methods have returned a cached value.- Specified by:
hitCount
in interfaceCacheStats
- Returns:
- the number of times cache lookup methods have returned a cached value.
-
hitRate
Description copied from interface:CacheStats
Returns the ratio of cache requests which were hits. This is defined as hitCount/requestCount. If requestCount equals 0, return 1- Specified by:
hitRate
in interfaceCacheStats
- Returns:
- the ratio of cache requests which were hits.
-
missCount
Description copied from interface:CacheStats
Returns the number of times cache lookup methods have returned an uncached (newly loaded) value, or null.- Specified by:
missCount
in interfaceCacheStats
- Returns:
- missCount
-
missRate
Description copied from interface:CacheStats
Returns the ratio of cache requests which were misses. This is defined as missCount/requestCount. If requestCount equals 0, return 0- Specified by:
missRate
in interfaceCacheStats
- Returns:
- the ratio of cache requests which were misses.
-
evictionCount
Description copied from interface:CacheStats
Returns the number of times an entry has been evicted. This count does not include manual invalidations.- Specified by:
evictionCount
in interfaceCacheStats
- Returns:
- the number of times an entry has been evicted.
-
evictionRate
Description copied from interface:CacheStats
Returns the ratio of cache requests that lead to an eviction. This is defined as evictionCount/requestCount. If requestCount equals 0, return 0- Specified by:
evictionRate
in interfaceCacheStats
- Returns:
- the ratio of cache requests that lead to an eviction.
-
minus
Description copied from interface:CacheStats
Returns a new CacheStats representing the difference between this CacheStats and other.- Specified by:
minus
in interfaceCacheStats
- Parameters:
cacheStats
- the other CacheStats- Returns:
- the CacheStats representing the difference between this CacheStats and other.
-
plus
Description copied from interface:CacheStats
Returns a new CacheStats representing the sum between this CacheStats and other- Specified by:
plus
in interfaceCacheStats
- Parameters:
cacheStats
- the other CacheStats- Returns:
- the new CacheStats representing the sum between this CacheStats and other.
-