类 CacheMetricsRegistrar
- java.lang.Object
- org.springframework.boot.actuate.metrics.cache.CacheMetricsRegistrar
public class CacheMetricsRegistrar extends Object
Register supportedCache
to aMeterRegistry
.- 从以下版本开始:
- 2.0.0
构造器概要
构造器 构造器 说明 CacheMetricsRegistrar(io.micrometer.core.instrument.MeterRegistry registry, Collection<CacheMeterBinderProvider<?>> binderProviders)
Creates a new registrar.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
bindCacheToRegistry(org.springframework.cache.Cache cache, io.micrometer.core.instrument.Tag... tags)
Attempt to bind the specifiedCache
to the registry.protected Iterable<io.micrometer.core.instrument.Tag>
getAdditionalTags(org.springframework.cache.Cache cache)
Return additionaltags
to be associated with the givenCache
.
构造器详细资料
CacheMetricsRegistrar
public CacheMetricsRegistrar(io.micrometer.core.instrument.MeterRegistry registry, Collection<CacheMeterBinderProvider<?>> binderProviders)
Creates a new registrar.- 参数:
registry
- theMeterRegistry
to usebinderProviders
- theCacheMeterBinderProvider
instances that should be used to detect compatible caches
方法详细资料
bindCacheToRegistry
public boolean bindCacheToRegistry(org.springframework.cache.Cache cache, io.micrometer.core.instrument.Tag... tags)
Attempt to bind the specifiedCache
to the registry. Returntrue
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 cache- 返回:
true
if thecache
is supported and was registered
getAdditionalTags
protected Iterable<io.micrometer.core.instrument.Tag> getAdditionalTags(org.springframework.cache.Cache cache)
Return additionaltags
to be associated with the givenCache
.- 参数:
cache
- the cache- 返回:
- a list of additional tags to associate to that
cache
.