public class GuavaCacheMetrics extends java.lang.Object implements MeterBinder
| Constructor and Description |
|---|
GuavaCacheMetrics(java.lang.String name,
java.lang.Iterable<Tag> tags,
com.google.common.cache.Cache<?,?> cache) |
| Modifier and Type | Method and Description |
|---|---|
void |
bindTo(MeterRegistry registry) |
static <C extends com.google.common.cache.Cache> |
monitor(MeterRegistry registry,
C cache,
java.lang.String name,
java.lang.Iterable<Tag> tags)
Record metrics on a Guava cache.
|
static <C extends com.google.common.cache.Cache> |
monitor(MeterRegistry registry,
C cache,
java.lang.String name,
java.lang.String... tags)
Record metrics on a Guava cache.
|
public GuavaCacheMetrics(java.lang.String name,
java.lang.Iterable<Tag> tags,
com.google.common.cache.Cache<?,?> cache)
public static <C extends com.google.common.cache.Cache> C monitor(MeterRegistry registry, C cache, java.lang.String name, java.lang.String... tags)
CacheBuilder.recordStats() prior to building the cache
for metrics to be recorded.registry - The registry to bind metrics to.cache - The cache to instrument.name - The name prefix of the metrics.tags - Tags to apply to all recorded metrics.CacheStatspublic static <C extends com.google.common.cache.Cache> C monitor(MeterRegistry registry, C cache, java.lang.String name, java.lang.Iterable<Tag> tags)
CacheBuilder.recordStats() prior to building the cache
for metrics to be recorded.registry - The registry to bind metrics to.cache - The cache to instrument.name - The name prefix of the metrics.tags - Tags to apply to all recorded metrics.CacheStatspublic void bindTo(MeterRegistry registry)
bindTo in interface MeterBinder