Package com.google.common.cache
Class AbstractCache.SimpleStatsCounter
java.lang.Object
com.google.common.cache.AbstractCache.SimpleStatsCounter
- All Implemented Interfaces:
AbstractCache.StatsCounter
- Enclosing class:
AbstractCache<K,
V>
@Beta
@Deprecated(since="2022-12-01")
public static final class AbstractCache.SimpleStatsCounter
extends Object
implements AbstractCache.StatsCounter
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
A thread-safe
AbstractCache.StatsCounter
implementation for use by Cache
implementors.- Since:
- 10.0
-
Constructor Summary
ConstructorDescriptionDeprecated.Constructs an instance with all counts initialized to zero. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.Increments all counters by the values inother
.void
Deprecated.Records the eviction of an entry from the cache.void
recordHits
(int count) Deprecated.Records cache hits.void
recordLoadException
(long loadTime) Deprecated.Records the failed load of a new entry.void
recordLoadSuccess
(long loadTime) Deprecated.Records the successful load of a new entry.void
recordMisses
(int count) Deprecated.Records cache misses.snapshot()
Deprecated.Returns a snapshot of this counter's values.
-
Constructor Details
-
SimpleStatsCounter
public SimpleStatsCounter()Deprecated.Constructs an instance with all counts initialized to zero.
-
-
Method Details
-
recordHits
public void recordHits(int count) Deprecated.Description copied from interface:AbstractCache.StatsCounter
Records cache hits. This should be called when a cache request returns a cached value.- Specified by:
recordHits
in interfaceAbstractCache.StatsCounter
- Parameters:
count
- the number of hits to record- Since:
- 11.0
-
recordMisses
public void recordMisses(int count) Deprecated.Description copied from interface:AbstractCache.StatsCounter
Records cache misses. This should be called when a cache request returns a value that was not found in the cache. This method should be called by the loading thread, as well as by threads blocking on the load. Multiple concurrent calls toCache
lookup methods with the same key on an absent value should result in a single call to eitherrecordLoadSuccess
orrecordLoadException
and multiple calls to this method, despite all being served by the results of a single load operation.- Specified by:
recordMisses
in interfaceAbstractCache.StatsCounter
- Parameters:
count
- the number of misses to record- Since:
- 11.0
-
recordLoadSuccess
public void recordLoadSuccess(long loadTime) Deprecated.Description copied from interface:AbstractCache.StatsCounter
Records the successful load of a new entry. This should be called when a cache request causes an entry to be loaded, and the loading completes successfully. In contrast toAbstractCache.StatsCounter.recordMisses(int)
, this method should only be called by the loading thread.- Specified by:
recordLoadSuccess
in interfaceAbstractCache.StatsCounter
- Parameters:
loadTime
- the number of nanoseconds the cache spent computing or retrieving the new value
-
recordLoadException
public void recordLoadException(long loadTime) Deprecated.Description copied from interface:AbstractCache.StatsCounter
Records the failed load of a new entry. This should be called when a cache request causes an entry to be loaded, but an exception is thrown while loading the entry. In contrast toAbstractCache.StatsCounter.recordMisses(int)
, this method should only be called by the loading thread.- Specified by:
recordLoadException
in interfaceAbstractCache.StatsCounter
- Parameters:
loadTime
- the number of nanoseconds the cache spent computing or retrieving the new value prior to an exception being thrown
-
recordEviction
public void recordEviction()Deprecated.Description copied from interface:AbstractCache.StatsCounter
Records the eviction of an entry from the cache. This should only been called when an entry is evicted due to the cache's eviction strategy, and not as a result of manual invalidations.- Specified by:
recordEviction
in interfaceAbstractCache.StatsCounter
-
snapshot
Deprecated.Description copied from interface:AbstractCache.StatsCounter
Returns a snapshot of this counter's values. Note that this may be an inconsistent view, as it may be interleaved with update operations.- Specified by:
snapshot
in interfaceAbstractCache.StatsCounter
-
incrementBy
Deprecated.Increments all counters by the values inother
.
-