Class GuavaCacheStats

    • 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 interface CacheStats
        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 interface CacheStats
        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 interface CacheStats
        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 interface CacheStats
        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 interface CacheStats
        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 interface CacheStats
        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 interface CacheStats
        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 interface CacheStats
        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 interface CacheStats
        Parameters:
        cacheStats - the other CacheStats
        Returns:
        the new CacheStats representing the sum between this CacheStats and other.