Class CacheStatistics

java.lang.Object
sonia.scm.cache.CacheStatistics

public final class CacheStatistics extends Object
Statistics about the performance of a Cache. Instances of this class are immutable.
Since:
2.0.0
  • Constructor Details

    • CacheStatistics

      public CacheStatistics(String name, long hitCount, long missCount)
      Constructs a new performance statistic for a Cache.
      Parameters:
      name - name of the cache
      hitCount - hit count
      missCount - miss count
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getHitCount

      public long getHitCount()
      Returns number of times requested elements were found in the cache.
      Returns:
      number of cache hits
    • getHitRate

      public double getHitRate()
      Returns the ratio of cache requests which were hits.
    • getMissCount

      public long getMissCount()
      Returns number of times a requested element was not found in the cache.
    • getMissRate

      public double getMissRate()
      Returns the ratio of cache requests which were misses.
    • getName

      public String getName()
      Returns name of the cache.
    • getRequestCount

      public long getRequestCount()
      Returns the total number of requests, this includes hits and misses.