Class 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:
    Serialized Form
    • Constructor Detail

      • RICacheStatistics

        public RICacheStatistics​(org.infinispan.AdvancedCache<?,​?> cache)
        Constructs a cache statistics object
        Parameters:
        cache - the associated cache
    • Method Detail

      • clear

        public void clear()

        Statistics will also automatically be cleared if internal counters overflow.

        Specified by:
        clear in interface javax.cache.management.CacheStatisticsMXBean
      • getCacheHits

        public long getCacheHits()
        Specified by:
        getCacheHits in interface javax.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 interface javax.cache.management.CacheStatisticsMXBean
        Returns:
        the percentage of successful hits, as a decimal
      • getCacheMisses

        public long getCacheMisses()
        Specified by:
        getCacheMisses in interface javax.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 interface javax.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 interface javax.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 interface javax.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 interface javax.cache.management.CacheStatisticsMXBean
        Returns:
        the number of removals
      • getCacheEvictions

        public long getCacheEvictions()
        Specified by:
        getCacheEvictions in interface javax.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 interface javax.cache.management.CacheStatisticsMXBean
        Returns:
        the time in µs
      • getAveragePutTime

        public float getAveragePutTime()
        The mean time to execute puts.
        Specified by:
        getAveragePutTime in interface javax.cache.management.CacheStatisticsMXBean
        Returns:
        the time in µs
      • getAverageRemoveTime

        public float getAverageRemoveTime()
        The mean time to execute removes.
        Specified by:
        getAverageRemoveTime in interface javax.cache.management.CacheStatisticsMXBean
        Returns:
        the time in µs
      • increaseCacheHits

        public void increaseCacheHits​(long number)
      • addGetTimeNano

        public void addGetTimeNano​(long duration)