Class CacheMetricsRegistrar
java.lang.Object
org.springframework.boot.cache.metrics.CacheMetricsRegistrar
-
Constructor Summary
ConstructorsConstructorDescriptionCacheMetricsRegistrar(io.micrometer.core.instrument.MeterRegistry registry, Collection<CacheMeterBinderProvider<?>> binderProviders) Creates a new registrar. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbindCacheToRegistry(Cache cache, io.micrometer.core.instrument.Tag... tags) Attempt to bind the specifiedCacheto the registry.protected Iterable<io.micrometer.core.instrument.Tag> getAdditionalTags(Cache cache) Return additionaltagsto be associated with the givenCache.
-
Constructor Details
-
CacheMetricsRegistrar
public CacheMetricsRegistrar(io.micrometer.core.instrument.MeterRegistry registry, Collection<CacheMeterBinderProvider<?>> binderProviders) Creates a new registrar.- Parameters:
registry- theMeterRegistryto usebinderProviders- theCacheMeterBinderProviderinstances that should be used to detect compatible caches
-
-
Method Details
-
bindCacheToRegistry
Attempt to bind the specifiedCacheto the registry. Returntrueif the cache is supported and was bound to the registry,falseotherwise.- Parameters:
cache- the cache to handletags- the tags to associate with the metrics of that cache- Returns:
trueif thecacheis supported and was registered
-
getAdditionalTags
-