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 of
CacheStatisticsMXBean.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRICacheStatistics(org.infinispan.AdvancedCache<?, ?> cache) Constructs a cache statistics object -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGetTimeNano(long duration) voidclear()floatThe mean time to execute gets.floatThe mean time to execute puts.floatThe mean time to execute removes.longlongThe total number of requests to the cache.floatReturns cache hits as a percentage of total gets.longlongfloatReturns cache misses as a percentage of total gets.longThe total number of puts to the cache.longThe total number of removals from the cache.voidincreaseCacheHits(long number)
-
Constructor Details
-
RICacheStatistics
public RICacheStatistics(org.infinispan.AdvancedCache<?, ?> cache) Constructs a cache statistics object- Parameters:
cache- the associated cache
-
-
Method Details
-
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)
-