@NonNullApi @NonNullFields public class HazelcastCacheMetrics extends CacheMeterBinder
| Constructor and Description |
|---|
HazelcastCacheMetrics(C cache,
Iterable<Tag> tags) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bindImplementationSpecificMetrics(MeterRegistry registry)
Bind detailed metrics that are particular to the cache implementation, e.g. load duration for
Caffeine caches, heap and disk size for EhCache caches.
|
protected Long |
evictionCount() |
protected long |
hitCount() |
protected Long |
missCount() |
static <K,V,C extends <any>> |
monitor(MeterRegistry registry,
C cache,
Iterable<Tag> tags)
Record metrics on a Hazelcast cache.
|
static <K,V,C extends <any>> |
monitor(MeterRegistry registry,
C cache,
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 Long |
size()
MOST cache implementations provide a means of retrieving the number of entries.
|
bindTo, getTagsWithCacheNamepublic static <K,V,C extends <any>> C monitor(MeterRegistry registry, C cache, String... tags)
C - The cache type.K - The cache key type.V - The cache value type.registry - The registry to bind metrics to.cache - The cache to instrument.tags - Tags to apply to all recorded metrics. Must be an even number of arguments representing key/value pairs of tags.public static <K,V,C extends <any>> C monitor(MeterRegistry registry, C cache, Iterable<Tag> tags)
C - The cache type.K - The cache key type.V - The cache value type.registry - The registry to bind metrics to.cache - The cache to instrument.tags - Tags to apply to all recorded metrics.protected Long size()
CacheMeterBindersize in class CacheMeterBindernull if the cache implementation does not provide a way to track cache size.protected long hitCount()
hitCount in class CacheMeterBindercache. 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 Long missCount()
missCount in class CacheMeterBinder@Nullable protected Long evictionCount()
evictionCount in class CacheMeterBindernull if the cache implementation does not support eviction, or does not provide a way to track
the eviction count.protected long putCount()
CacheMeterBinderputCount in class CacheMeterBinderprotected void bindImplementationSpecificMetrics(MeterRegistry registry)
CacheMeterBinderbindImplementationSpecificMetrics in class CacheMeterBinderregistry - The registry to bind metrics to.Copyright © 2020 LeanCloud. All rights reserved.