@NonNullApi @NonNullFields public class HazelcastCacheMetrics extends CacheMeterBinder
Constructor and Description |
---|
HazelcastCacheMetrics(java.lang.Object cache,
java.lang.Iterable<Tag> tags)
Binder for Hazelcast cache metrics.
|
Modifier and Type | Method and Description |
---|---|
protected void |
bindImplementationSpecificMetrics(MeterRegistry registry)
Bind detailed metrics that are particular to the cache implementation, e.g.
|
protected java.lang.Long |
evictionCount() |
protected long |
hitCount() |
protected java.lang.Long |
missCount() |
static java.lang.Object |
monitor(MeterRegistry registry,
java.lang.Object cache,
java.lang.Iterable<Tag> tags)
Record metrics on a Hazelcast cache.
|
static java.lang.Object |
monitor(MeterRegistry registry,
java.lang.Object cache,
java.lang.String... tags)
Record metrics on a Hazelcast cache.
|
protected long |
putCount()
The put mechanism is unimportant - this count applies to entries added to the cache according to a pre-defined
load function such as exists in Guava/Caffeine caches as well as manual puts.
|
protected java.lang.Long |
size()
MOST cache implementations provide a means of retrieving the number of entries.
|
bindTo, getTagsWithCacheName
public HazelcastCacheMetrics(java.lang.Object cache, java.lang.Iterable<Tag> tags)
cache
- Hazelcast IMap cache to instrumenttags
- Tags to apply to all recorded metrics.public static java.lang.Object monitor(MeterRegistry registry, java.lang.Object cache, java.lang.String... tags)
registry
- registry to bind metrics tocache
- Hazelcast IMap cache to instrumenttags
- Tags to apply to all recorded metrics. Must be an even number of arguments representing key/value pairs of tags.public static java.lang.Object monitor(MeterRegistry registry, java.lang.Object cache, java.lang.Iterable<Tag> tags)
registry
- registry to bind metrics tocache
- Hazelcast IMap cache to instrumenttags
- Tags to apply to all recorded metrics.protected java.lang.Long size()
CacheMeterBinder
size
in class CacheMeterBinder
null
if the cache implementation does not provide a way to track cache size.protected long hitCount()
hitCount
in class CacheMeterBinder
cache
. If a get operation elsewhere in the cluster caused a lookup against an entry
held in this partition, the hit will be recorded against map stats in this partition and not in the map stats of the
calling IMap
.protected java.lang.Long missCount()
missCount
in class CacheMeterBinder
@Nullable protected java.lang.Long evictionCount()
evictionCount
in class CacheMeterBinder
null
if the cache implementation does not support eviction, or does not provide a way to track
the eviction count.protected long putCount()
CacheMeterBinder
putCount
in class CacheMeterBinder
protected void bindImplementationSpecificMetrics(MeterRegistry registry)
CacheMeterBinder
bindImplementationSpecificMetrics
in class CacheMeterBinder
registry
- The registry to bind metrics to.