类 CacheMetricsRegistrar

java.lang.Object
org.springframework.boot.actuate.metrics.cache.CacheMetricsRegistrar

public class CacheMetricsRegistrar extends Object
Register supported Cache to a MeterRegistry.
从以下版本开始:
2.0.0
作者:
Stephane Nicoll
  • 构造器详细资料

    • CacheMetricsRegistrar

      public CacheMetricsRegistrar(io.micrometer.core.instrument.MeterRegistry registry, Collection<CacheMeterBinderProvider<?>> binderProviders)
      Creates a new registrar.
      参数:
      registry - the MeterRegistry to use
      binderProviders - the CacheMeterBinderProvider instances that should be used to detect compatible caches
  • 方法详细资料

    • bindCacheToRegistry

      public boolean bindCacheToRegistry(Cache cache, io.micrometer.core.instrument.Tag... tags)
      Attempt to bind the specified Cache to the registry. Return true if the cache is supported and was bound to the registry, false otherwise.
      参数:
      cache - the cache to handle
      tags - the tags to associate with the metrics of that cache
      返回:
      true if the cache is supported and was registered
    • getAdditionalTags

      protected Iterable<io.micrometer.core.instrument.Tag> getAdditionalTags(Cache cache)
      Return additional tags to be associated with the given Cache.
      参数:
      cache - the cache
      返回:
      a list of additional tags to associate to that cache.