Returns a new CacheStats representing the sum of this CacheStats
and other
.
Returns a new CacheStats representing the difference between this CacheStats
and other
.
Returns a new CacheStats representing the difference between this CacheStats
and other
. Negative values, which aren't supported by CacheStats will be
rounded up to zero.
Returns the average time spent loading new values.
Returns the average time spent loading new values. This is defined as
totalLoadTime / (loadSuccessCount + loadExceptionCount)
.
Returns the ratio of cache requests which were hits.
Returns the ratio of cache requests which were hits. This is defined as
hitCount / requestCount
, or 1.0
when requestCount == 0
.
Note that hitRate + missRate =~ 1.0
.
Returns the total number of times that Cache lookup methods attempted to load new values.
Returns the total number of times that Cache lookup methods attempted to load new
values. This includes both successful load operations, as well as those that threw
exceptions. This is defined as loadSuccessCount + loadExceptionCount
.
Returns the ratio of cache loading attempts which threw exceptions.
Returns the ratio of cache loading attempts which threw exceptions. This is defined as
loadExceptionCount / (loadSuccessCount + loadExceptionCount)
, or
0.0
when loadSuccessCount + loadExceptionCount == 0
.
Returns the ratio of cache requests which were misses.
Returns the ratio of cache requests which were misses. This is defined as
missCount / requestCount
, or 0.0
when requestCount == 0
.
Note that hitRate + missRate =~ 1.0
. Cache misses include all requests which
weren't cache hits, including requests which resulted in either successful or failed loading
attempts, and requests which waited for other threads to finish loading. It is thus the case
that missCount >= loadSuccessCount + loadExceptionCount
. Multiple
concurrent misses for the same key will result in a single load operation.
Returns the number of times Cache lookup methods have returned either a cached or uncached value.
Returns the number of times Cache lookup methods have returned either a cached or
uncached value. This is defined as hitCount + missCount
.
Statistics about the performance of a Cache. Instances of this class are immutable.
Cache statistics are incremented according to the following rules:
hitCount
is incremented.missCount
andloadSuccessCount
are incremented, and the total loading time, in nanoseconds, is added tototalLoadTime
.missCount
andloadExceptionCount
are incremented, and the total loading time, in nanoseconds, is added tototalLoadTime
.missCount
.evictionCount
is incremented.Cache#getIfPresent
.A lookup is specifically defined as an invocation of one of the methods
LoadingCache#get(key)
,Cache#get(key, loader)
, orLoadingCache#getAll(keys)
.0.7 (copied from Guava-libraries)