|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.common.cache.AbstractCache.SimpleStatsCounter
@Beta public static class AbstractCache.SimpleStatsCounter
A thread-safe AbstractCache.StatsCounter implementation for use by Cache implementors.
| Constructor Summary | |
|---|---|
AbstractCache.SimpleStatsCounter()
|
|
| Method Summary | |
|---|---|
void |
incrementBy(AbstractCache.StatsCounter other)
Increments all counters by the values in other. |
void |
recordConcurrentMiss()
Records a single concurrent miss. |
void |
recordEviction()
Records the eviction of an entry from the cache. |
void |
recordHit()
Records a single hit. |
void |
recordLoadException(long loadTime)
Records the failed load of a new entry. |
void |
recordLoadSuccess(long loadTime)
Records the successful load of a new entry. |
CacheStats |
snapshot()
Returns a snapshot of this counter's values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractCache.SimpleStatsCounter()
| Method Detail |
|---|
public void recordHit()
AbstractCache.StatsCounter
recordHit in interface AbstractCache.StatsCounterpublic void recordLoadSuccess(long loadTime)
AbstractCache.StatsCounterAbstractCache.StatsCounter.recordConcurrentMiss(), this method should only be called by the loading thread.
recordLoadSuccess in interface AbstractCache.StatsCounterloadTime - the number of nanoseconds the cache spent computing or retrieving the new
valuepublic void recordLoadException(long loadTime)
AbstractCache.StatsCounterAbstractCache.StatsCounter.recordConcurrentMiss(), this method should only be called by the loading thread.
recordLoadException in interface AbstractCache.StatsCounterloadTime - the number of nanoseconds the cache spent computing or retrieving the new
value prior to an exception being thrownpublic void recordConcurrentMiss()
AbstractCache.StatsCounterAbstractCache.StatsCounter.recordLoadSuccess(long)
and AbstractCache.StatsCounter.recordLoadException(long), this method should never be called by the loading
thread. Multiple concurrent calls to Cache lookup methods with the same key on an
absent value should result in a single call to either recordLoadSuccess or
recordLoadException and multiple calls to this method, despite all being served by
the results of a single load operation.
recordConcurrentMiss in interface AbstractCache.StatsCounterpublic void recordEviction()
AbstractCache.StatsCounter
recordEviction in interface AbstractCache.StatsCounterpublic CacheStats snapshot()
AbstractCache.StatsCounter
snapshot in interface AbstractCache.StatsCounterpublic void incrementBy(AbstractCache.StatsCounter other)
other.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||