Class HazelcastCacheMetrics
java.lang.Object
io.micrometer.core.instrument.binder.cache.CacheMeterBinder<Object>
io.micrometer.core.instrument.binder.cache.HazelcastCacheMetrics
- All Implemented Interfaces:
MeterBinder
Collect metrics on Hazelcast caches, including detailed metrics on storage space, near
cache usage, and timings.
-
Constructor Summary
ConstructorsConstructorDescriptionHazelcastCacheMetrics(Object cache, Iterable<Tag> tags) Binder for Hazelcast cache metrics. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidBind detailed metrics that are particular to the cache implementation, e.g.protected @Nullable Longprotected longhitCount()protected @Nullable Longstatic Objectmonitor(MeterRegistry registry, Object cache, Iterable<Tag> tags) Record metrics on a Hazelcast cache.static Objectmonitor(MeterRegistry registry, Object cache, String... tags) Record metrics on a Hazelcast cache.protected longputCount()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 @Nullable Longsize()MOST cache implementations provide a means of retrieving the number of entries.Methods inherited from class io.micrometer.core.instrument.binder.cache.CacheMeterBinder
bindTo, getCache, getTagsWithCacheName
-
Constructor Details
-
HazelcastCacheMetrics
Binder for Hazelcast cache metrics.- Parameters:
cache- Hazelcast IMap cache to instrumenttags- Tags to apply to all recorded metrics.
-
-
Method Details
-
monitor
Record metrics on a Hazelcast cache.- Parameters:
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.- Returns:
- The instrumented cache, unchanged. The original cache is not wrapped or proxied in any way.
-
monitor
Record metrics on a Hazelcast cache.- Parameters:
registry- registry to bind metrics tocache- Hazelcast IMap cache to instrumenttags- Tags to apply to all recorded metrics.- Returns:
- The instrumented cache, unchanged. The original cache is not wrapped or proxied in any way.
-
size
Description copied from class:CacheMeterBinderMOST cache implementations provide a means of retrieving the number of entries. Even if- Specified by:
sizein classCacheMeterBinder<Object>- Returns:
- Total number of cache entries. This value may go up or down with puts,
removes, and evictions. Returns
nullif the cache implementation does not provide a way to track cache size.
-
hitCount
protected long hitCount()- Specified by:
hitCountin classCacheMeterBinder<Object>- Returns:
- The number of hits against cache entries held in this local partition. Not
all gets had to result from a get operation against
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 callingIMap.
-
missCount
- Specified by:
missCountin classCacheMeterBinder<Object>- Returns:
- There is no way to calculate miss count in Hazelcast. See issue #586.
-
evictionCount
- Specified by:
evictionCountin classCacheMeterBinder<Object>- Returns:
- Total number of entries that have been evicted from the cache.
Monotonically increasing eviction count. Returns
nullif the cache implementation does not support eviction, or does not provide a way to track the eviction count.
-
putCount
protected long putCount()Description copied from class:CacheMeterBinderThe 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. Note that Guava/Caffeine caches don't count manual puts. Returns -1 if the cache implementation does not support this.- Specified by:
putCountin classCacheMeterBinder<Object>- Returns:
- Total number of entries added to the cache. Monotonically increasing count.
-
bindImplementationSpecificMetrics
Description copied from class:CacheMeterBinderBind detailed metrics that are particular to the cache implementation, e.g. load duration for Caffeine caches, heap and disk size for EhCache caches. These metrics are above and beyond the basic set of metrics that is common to all caches.- Specified by:
bindImplementationSpecificMetricsin classCacheMeterBinder<Object>- Parameters:
registry- The registry to bind metrics to.
-