@NonNullApi @NonNullFields public class EhCache2Metrics extends CacheMeterBinder
| Constructor and Description |
|---|
EhCache2Metrics(net.sf.ehcache.Ehcache cache,
java.lang.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.
|
protected java.lang.Long |
evictionCount() |
protected long |
hitCount() |
protected java.lang.Long |
missCount() |
static net.sf.ehcache.Ehcache |
monitor(MeterRegistry registry,
net.sf.ehcache.Ehcache cache,
java.lang.Iterable<Tag> tags)
Record metrics on a JCache cache.
|
static net.sf.ehcache.Ehcache |
monitor(MeterRegistry registry,
net.sf.ehcache.Ehcache cache,
java.lang.String... tags)
Record metrics on a JCache 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, getTagsWithCacheNamepublic EhCache2Metrics(net.sf.ehcache.Ehcache cache,
java.lang.Iterable<Tag> tags)
public static net.sf.ehcache.Ehcache monitor(MeterRegistry registry, net.sf.ehcache.Ehcache cache, java.lang.String... tags)
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.CacheStatspublic static net.sf.ehcache.Ehcache monitor(MeterRegistry registry, net.sf.ehcache.Ehcache cache, java.lang.Iterable<Tag> tags)
registry - The registry to bind metrics to.cache - The cache to instrument.tags - Tags to apply to all recorded metrics.CacheStatsprotected java.lang.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 CacheMeterBinderprotected java.lang.Long missCount()
missCount in class CacheMeterBindernull if the cache implementation does not provide a way to track miss count, especially in distributed
caches.protected java.lang.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.