public class CacheMetricsRegistrar extends Object
Cache
to a MeterRegistry
.Constructor and Description |
---|
CacheMetricsRegistrar(io.micrometer.core.instrument.MeterRegistry registry,
Collection<CacheMeterBinderProvider<?>> binderProviders)
Creates a new registrar.
|
Modifier and Type | Method and Description |
---|---|
boolean |
bindCacheToRegistry(org.springframework.cache.Cache cache,
io.micrometer.core.instrument.Tag... tags)
Attempt to bind the specified
Cache to the registry. |
protected Iterable<io.micrometer.core.instrument.Tag> |
getAdditionalTags(org.springframework.cache.Cache cache)
Return additional
tags to be associated with the given Cache . |
public CacheMetricsRegistrar(io.micrometer.core.instrument.MeterRegistry registry, Collection<CacheMeterBinderProvider<?>> binderProviders)
registry
- the MeterRegistry
to usebinderProviders
- the CacheMeterBinderProvider
instances that should
be used to detect compatible cachespublic boolean bindCacheToRegistry(org.springframework.cache.Cache cache, io.micrometer.core.instrument.Tag... tags)
Cache
to the registry. Return true
if
the cache is supported and was bound to the registry, false
otherwise.cache
- the cache to handletags
- the tags to associate with the metrics of that cachetrue
if the cache
is supported and was registeredprotected Iterable<io.micrometer.core.instrument.Tag> getAdditionalTags(org.springframework.cache.Cache cache)
tags
to be associated with the given Cache
.cache
- the cachecache
.Copyright © 2020 Pivotal Software, Inc.. All rights reserved.