Class GuavaCacheStats
- java.lang.Object
-
- org.ametys.plugins.core.impl.cache.GuavaCacheStats
-
- All Implemented Interfaces:
CacheStats
public class GuavaCacheStats extends Object implements CacheStats
Guava implementation of CacheStats
-
-
Field Summary
Fields Modifier and Type Field Description private CacheStats
_cacheStats
-
Constructor Summary
Constructors Constructor Description GuavaCacheStats()
GuavaCacheStats implementation of CacheStatsGuavaCacheStats(CacheStats cacheStats)
GuavaCacheStats implementation of CacheStats
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
evictionCount()
Returns the number of times an entry has been evicted.double
evictionRate()
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.CacheStats
minus(CacheStats cacheStats)
Returns a new CacheStats representing the difference between this CacheStats and other.long
missCount()
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.CacheStats
plus(CacheStats cacheStats)
Returns a new CacheStats representing the sum between this CacheStats and otherlong
requestCount()
Returns the number of times cache lookup methods have returned either a cached or uncached value.
-
-
-
Field Detail
-
_cacheStats
private CacheStats _cacheStats
-
-
Constructor Detail
-
GuavaCacheStats
public GuavaCacheStats()
GuavaCacheStats implementation of CacheStats
-
GuavaCacheStats
public GuavaCacheStats(CacheStats cacheStats)
GuavaCacheStats implementation of CacheStats- Parameters:
cacheStats
- stats of Guava cache
-
-
Method Detail
-
requestCount
public long 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
public long 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
public double 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
public long 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
public double 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
public long 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
public double 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
public CacheStats minus(CacheStats cacheStats)
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
public CacheStats plus(CacheStats cacheStats)
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.
-
-