Package sonia.scm.cache
Class CacheStatistics
java.lang.Object
sonia.scm.cache.CacheStatistics
Statistics about the performance of a
Cache.
Instances of this class are immutable.- Since:
- 2.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionCacheStatistics(String name, long hitCount, long missCount) Constructs a new performance statistic for aCache. -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongReturns number of times requested elements were found in the cache.doubleReturns the ratio of cache requests which were hits.longReturns number of times a requested element was not found in the cache.doubleReturns the ratio of cache requests which were misses.getName()Returns name of the cache.longReturns the total number of requests, this includes hits and misses.inthashCode()toString()
-
Constructor Details
-
CacheStatistics
Constructs a new performance statistic for aCache.- Parameters:
name- name of the cachehitCount- hit countmissCount- miss count
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
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
Returns name of the cache. -
getRequestCount
public long getRequestCount()Returns the total number of requests, this includes hits and misses.
-