Top Description Fields Constructors Methods
com.github.benmanes.caffeine.cache.stats

pack-priv final Class GuardedStatsCounter

extends Object
implements StatsCounter
Class Inheritance
All Implemented Interfaces
com.github.benmanes.caffeine.cache.stats.StatsCounter
Annotations
@SuppressWarnings:PMD.AvoidDuplicateLiterals
Static Imports
java.util.Objects.requireNonNull

A StatsCounter implementation that suppresses and logs any exception thrown by the delegate statsCounter.
Author
[email protected] (Ben Manes)

Field Summary

Modifier and TypeField and Description
pack-priv final StatsCounter
pack-priv static final System.Logger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
recordEviction(int weight, RemovalCause cause)

public void
recordHits(int count)

public void
recordLoadFailure(long loadTime)

public void
recordLoadSuccess(long loadTime)

public void
recordMisses(int count)

public CacheStats
snapshot()

Implements com.github.benmanes.caffeine.cache.stats.StatsCounter.snapshot.

Returns a snapshot of this counter's values.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

delegateback to summary
pack-priv final StatsCounter delegate
loggerback to summary
pack-priv static final System.Logger logger

Constructor Detail

GuardedStatsCounterback to summary
pack-priv GuardedStatsCounter(StatsCounter delegate)

Method Detail

recordEvictionback to summary
public void recordEviction(int weight, RemovalCause cause)
Annotations
@Override
recordHitsback to summary
public void recordHits(int count)
Annotations
@Override
recordLoadFailureback to summary
public void recordLoadFailure(long loadTime)
Annotations
@Override
recordLoadSuccessback to summary
public void recordLoadSuccess(long loadTime)
Annotations
@Override
recordMissesback to summary
public void recordMisses(int count)
Annotations
@Override
snapshotback to summary
public CacheStats snapshot()

Implements com.github.benmanes.caffeine.cache.stats.StatsCounter.snapshot.

Doc from com.github.benmanes.caffeine.cache.stats.StatsCounter.snapshot.

Returns a snapshot of this counter's values. Note that this may be an inconsistent view, as it may be interleaved with update operations.

Note

the values of the metrics are undefined in case of overflow (though it is guaranteed not to throw an exception). If you require specific handling, we recommend implementing your own stats collector.

Returns:CacheStats

a snapshot of this counter's values

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override