Package org.infinispan.jcache.embedded
Class RICacheStatistics
- java.lang.Object
-
- org.infinispan.jcache.embedded.RICacheStatistics
-
- All Implemented Interfaces:
Serializable
,javax.cache.management.CacheStatisticsMXBean
public class RICacheStatistics extends Object implements javax.cache.management.CacheStatisticsMXBean, Serializable
The reference implementation ofCacheStatisticsMXBean
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RICacheStatistics(org.infinispan.AdvancedCache<?,?> cache)
Constructs a cache statistics object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGetTimeNano(long duration)
void
clear()
float
getAverageGetTime()
The mean time to execute gets.float
getAveragePutTime()
The mean time to execute puts.float
getAverageRemoveTime()
The mean time to execute removes.long
getCacheEvictions()
long
getCacheGets()
The total number of requests to the cache.float
getCacheHitPercentage()
Returns cache hits as a percentage of total gets.long
getCacheHits()
long
getCacheMisses()
float
getCacheMissPercentage()
Returns cache misses as a percentage of total gets.long
getCachePuts()
The total number of puts to the cache.long
getCacheRemovals()
The total number of removals from the cache.void
increaseCacheHits(long number)
-
-
-
Method Detail
-
clear
public void clear()
Statistics will also automatically be cleared if internal counters overflow.- Specified by:
clear
in interfacejavax.cache.management.CacheStatisticsMXBean
-
getCacheHits
public long getCacheHits()
- Specified by:
getCacheHits
in interfacejavax.cache.management.CacheStatisticsMXBean
- Returns:
- the number of hits
-
getCacheHitPercentage
public float getCacheHitPercentage()
Returns cache hits as a percentage of total gets.- Specified by:
getCacheHitPercentage
in interfacejavax.cache.management.CacheStatisticsMXBean
- Returns:
- the percentage of successful hits, as a decimal
-
getCacheMisses
public long getCacheMisses()
- Specified by:
getCacheMisses
in interfacejavax.cache.management.CacheStatisticsMXBean
- Returns:
- the number of misses
-
getCacheMissPercentage
public float getCacheMissPercentage()
Returns cache misses as a percentage of total gets.- Specified by:
getCacheMissPercentage
in interfacejavax.cache.management.CacheStatisticsMXBean
- Returns:
- the percentage of accesses that failed to find anything
-
getCacheGets
public long getCacheGets()
The total number of requests to the cache. This will be equal to the sum of the hits and misses. A "get" is an operation that returns the current or previous value.- Specified by:
getCacheGets
in interfacejavax.cache.management.CacheStatisticsMXBean
- Returns:
- the number of hits
-
getCachePuts
public long getCachePuts()
The total number of puts to the cache. A put is counted even if it is immediately evicted. A replace includes a put and remove.- Specified by:
getCachePuts
in interfacejavax.cache.management.CacheStatisticsMXBean
- Returns:
- the number of hits
-
getCacheRemovals
public long getCacheRemovals()
The total number of removals from the cache. This does not include evictions, where the cache itself initiates the removal to make space.- Specified by:
getCacheRemovals
in interfacejavax.cache.management.CacheStatisticsMXBean
- Returns:
- the number of removals
-
getCacheEvictions
public long getCacheEvictions()
- Specified by:
getCacheEvictions
in interfacejavax.cache.management.CacheStatisticsMXBean
- Returns:
- the number of evictions from the cache
-
getAverageGetTime
public float getAverageGetTime()
The mean time to execute gets. In a read-through cache the time taken to load an entry on miss is not included in get time.- Specified by:
getAverageGetTime
in interfacejavax.cache.management.CacheStatisticsMXBean
- Returns:
- the time in µs
-
getAveragePutTime
public float getAveragePutTime()
The mean time to execute puts.- Specified by:
getAveragePutTime
in interfacejavax.cache.management.CacheStatisticsMXBean
- Returns:
- the time in µs
-
getAverageRemoveTime
public float getAverageRemoveTime()
The mean time to execute removes.- Specified by:
getAverageRemoveTime
in interfacejavax.cache.management.CacheStatisticsMXBean
- Returns:
- the time in µs
-
increaseCacheHits
public void increaseCacheHits(long number)
-
addGetTimeNano
public void addGetTimeNano(long duration)
-
-