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 voidaddGetTimeNano(long duration)voidclear()floatgetAverageGetTime()The mean time to execute gets.floatgetAveragePutTime()The mean time to execute puts.floatgetAverageRemoveTime()The mean time to execute removes.longgetCacheEvictions()longgetCacheGets()The total number of requests to the cache.floatgetCacheHitPercentage()Returns cache hits as a percentage of total gets.longgetCacheHits()longgetCacheMisses()floatgetCacheMissPercentage()Returns cache misses as a percentage of total gets.longgetCachePuts()The total number of puts to the cache.longgetCacheRemovals()The total number of removals from the cache.voidincreaseCacheHits(long number)
-
-
-
Method Detail
-
clear
public void clear()
Statistics will also automatically be cleared if internal counters overflow.- Specified by:
clearin interfacejavax.cache.management.CacheStatisticsMXBean
-
getCacheHits
public long getCacheHits()
- Specified by:
getCacheHitsin interfacejavax.cache.management.CacheStatisticsMXBean- Returns:
- the number of hits
-
getCacheHitPercentage
public float getCacheHitPercentage()
Returns cache hits as a percentage of total gets.- Specified by:
getCacheHitPercentagein interfacejavax.cache.management.CacheStatisticsMXBean- Returns:
- the percentage of successful hits, as a decimal
-
getCacheMisses
public long getCacheMisses()
- Specified by:
getCacheMissesin interfacejavax.cache.management.CacheStatisticsMXBean- Returns:
- the number of misses
-
getCacheMissPercentage
public float getCacheMissPercentage()
Returns cache misses as a percentage of total gets.- Specified by:
getCacheMissPercentagein 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:
getCacheGetsin 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:
getCachePutsin 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:
getCacheRemovalsin interfacejavax.cache.management.CacheStatisticsMXBean- Returns:
- the number of removals
-
getCacheEvictions
public long getCacheEvictions()
- Specified by:
getCacheEvictionsin 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:
getAverageGetTimein interfacejavax.cache.management.CacheStatisticsMXBean- Returns:
- the time in µs
-
getAveragePutTime
public float getAveragePutTime()
The mean time to execute puts.- Specified by:
getAveragePutTimein interfacejavax.cache.management.CacheStatisticsMXBean- Returns:
- the time in µs
-
getAverageRemoveTime
public float getAverageRemoveTime()
The mean time to execute removes.- Specified by:
getAverageRemoveTimein interfacejavax.cache.management.CacheStatisticsMXBean- Returns:
- the time in µs
-
increaseCacheHits
public void increaseCacheHits(long number)
-
addGetTimeNano
public void addGetTimeNano(long duration)
-
-