Class AbstractCache.SimpleStatsCounter

java.lang.Object
com.google.common.cache.AbstractCache.SimpleStatsCounter
All Implemented Interfaces:
AbstractCache.StatsCounter
Enclosing class:
AbstractCache<K,V>

public static final class AbstractCache.SimpleStatsCounter extends Object implements AbstractCache.StatsCounter
A thread-safe AbstractCache.StatsCounter implementation for use by Cache implementors.

Each counter is updated atomically, but the counters are not updated together: For performance, this class does not lock, so a snapshot() taken concurrently with updates may reflect only part of an update. For example, it may include the increment of the load-success count from a call to recordLoadSuccess(long) but not the corresponding load time. As a result, values derived from a snapshot, like CacheStats.averageLoadPenalty(), may be briefly inconsistent.

Since:
10.0
Author:
Charles Fry