Class GuavaCacheStats

java.lang.Object
org.ametys.plugins.core.impl.cache.GuavaCacheStats
All Implemented Interfaces:
CacheStats

public class GuavaCacheStats extends Object implements CacheStats
Guava implementation of CacheStats
  • Constructor Summary

    Constructors
    Constructor
    Description
    GuavaCacheStats implementation of CacheStats
    GuavaCacheStats implementation of CacheStats
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the number of times an entry has been evicted.
    double
    Returns the ratio of cache requests that lead to an eviction.
    long
    Returns the number of times cache lookup methods have returned a cached value.
    double
    Returns the ratio of cache requests which were hits.
    minus(CacheStats cacheStats)
    Returns a new CacheStats representing the difference between this CacheStats and other.
    long
    Returns the number of times cache lookup methods have returned an uncached (newly loaded) value, or null.
    double
    Returns the ratio of cache requests which were misses.
    plus(CacheStats cacheStats)
    Returns a new CacheStats representing the sum between this CacheStats and other
    long
    Returns the number of times cache lookup methods have returned either a cached or uncached value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GuavaCacheStats

      public GuavaCacheStats()
      GuavaCacheStats implementation of CacheStats
    • GuavaCacheStats

      public GuavaCacheStats(CacheStats cacheStats)
      GuavaCacheStats implementation of CacheStats
      Parameters:
      cacheStats - stats of Guava cache
  • Method Details

    • 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.