public class CacheStats extends Object implements CacheStatsMXBean
CacheStatsMXBean
interface.Constructor and Description |
---|
CacheStats(long cacheSize,
long hitCount,
long missCount,
long loadSuccessCount,
long loadExceptionCount,
long totalLoadTime,
long evictionCount) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
long |
getCacheSize() |
long |
getEvictionCount()
Returns the number of times an entry has been evicted.
|
long |
getHitCount()
Returns the number of times
com.google.common.cache.Cache lookup methods have returned a cached value. |
long |
getLoadExceptionCount()
Returns the number of times
com.google.common.cache.Cache lookup methods threw an exception while loading
a new value. |
long |
getLoadSuccessCount()
Returns the number of times
com.google.common.cache.Cache lookup methods have successfully loaded a new
value. |
long |
getMissCount()
Returns the number of times
com.google.common.cache.Cache lookup methods have returned an uncached (newly
loaded) value, or null. |
long |
getTotalLoadTime()
Returns the total number of nanoseconds the cache has spent loading new values.
|
int |
hashCode() |
String |
toString() |
public CacheStats(long cacheSize, long hitCount, long missCount, long loadSuccessCount, long loadExceptionCount, long totalLoadTime, long evictionCount)
public long getCacheSize()
public long getHitCount()
CacheStatsMXBean
com.google.common.cache.Cache
lookup methods have returned a cached value.getHitCount
in interface CacheStatsMXBean
com.google.common.cache.CacheStats#hitCount()
public long getMissCount()
CacheStatsMXBean
com.google.common.cache.Cache
lookup methods have returned an uncached (newly
loaded) value, or null. Multiple concurrent calls to com.google.common.cache.Cache
lookup methods on an
absent value can result in multiple misses, all returning the results of a single cache load operation.getMissCount
in interface CacheStatsMXBean
com.google.common.cache.CacheStats#missCount()
public long getLoadSuccessCount()
CacheStatsMXBean
com.google.common.cache.Cache
lookup methods have successfully loaded a new
value. This is usually incremented in conjunction with CacheStatsMXBean.getMissCount()
, though getMissCount
is
also incremented when an exception is encountered during cache loading (see CacheStatsMXBean.getLoadExceptionCount()
).
Multiple concurrent misses for the same key will result in a single load operation. This may be incremented not
in conjunction with getMissCount
if the load occurs as a result of a refresh or if the cache loader
returned more items than was requested. getMissCount
may also be incremented not in conjunction with this
(nor CacheStatsMXBean.getLoadExceptionCount()
) on calls to getIfPresent
.getLoadSuccessCount
in interface CacheStatsMXBean
com.google.common.cache.CacheStats#loadSuccessCount()
public long getLoadExceptionCount()
CacheStatsMXBean
com.google.common.cache.Cache
lookup methods threw an exception while loading
a new value. This is usually incremented in conjunction with getMissCount
, though getMissCount
is
also incremented when cache loading completes successfully (see CacheStatsMXBean.getLoadSuccessCount()
). Multiple
concurrent misses for the same key will result in a single load operation. This may be incremented not in
conjunction with getMissCount
if the load occurs as a result of a refresh or if the cache loader returned
more items than was requested. getMissCount
may also be incremented not in conjunction with this (nor
CacheStatsMXBean.getLoadSuccessCount()
) on calls to getIfPresent
.getLoadExceptionCount
in interface CacheStatsMXBean
com.google.common.cache.CacheStats#loadExceptionCount()
public long getTotalLoadTime()
CacheStatsMXBean
getLoadSuccessCount
or getLoadExceptionCount
is
incremented.getTotalLoadTime
in interface CacheStatsMXBean
com.google.common.cache.CacheStats#totalLoadTime()
public long getEvictionCount()
CacheStatsMXBean
getEvictionCount
in interface CacheStatsMXBean
com.google.common.cache.CacheStats#evictionCount()
protected boolean canEqual(Object other)
Copyright © 2020 SAP SE. All rights reserved.