Class MicrometerRemoteCacheManagerMetricsRegistry

java.lang.Object
org.infinispan.client.hotrod.metrics.micrometer.MicrometerRemoteCacheManagerMetricsRegistry
All Implemented Interfaces:
HotRodClientMetricsRegistry, RemoteCacheManagerMetricsRegistry

public class MicrometerRemoteCacheManagerMetricsRegistry extends Object implements RemoteCacheManagerMetricsRegistry
A RemoteCacheManagerMetricsRegistry implementation that uses Micrometer to register and expose metrics.

This class is instantiated using the MicrometerRemoteCacheManagerMetricsRegistry.Builder class.

Since:
15.1
  • Method Details

    • withCache

      public HotRodClientMetricsRegistry withCache(String cacheName)
      Description copied from interface: RemoteCacheManagerMetricsRegistry
      Returns a HotRodClientMetricsRegistry to be used to register a remote cache metrics.
      Specified by:
      withCache in interface RemoteCacheManagerMetricsRegistry
      Parameters:
      cacheName - The cache's name.
      Returns:
      The HotRodClientMetricsRegistry implementation to use.
    • removeCache

      public void removeCache(String cacheName)
      Description copied from interface: RemoteCacheManagerMetricsRegistry
      Removes and unregister all cache related metrics.
      Specified by:
      removeCache in interface RemoteCacheManagerMetricsRegistry
      Parameters:
      cacheName - The cache's name.
    • createCounter

      public org.infinispan.commons.stat.CounterTracker createCounter(String metricName, String description, Map<String,String> tags, Consumer<Object> generatedId)
      Description copied from interface: HotRodClientMetricsRegistry
      Create a counter metric.

      It keeps track of counting events and can never be decreased or reset. For example, the number of cache hits/misses.

      The Hot Rod client uses the returned CounterTracker to update the counter.

      Specified by:
      createCounter in interface HotRodClientMetricsRegistry
      Parameters:
      metricName - The metric name.
      description - A small description of the metrics to help explain what it measures.
      tags - Extra tags or information about the gauge (for example, cache name).
      generatedId - A Consumer to accept the generated ID. The ID will be used to unregister the metric on demand.
      Returns:
      The CounterTracker implementation.
    • createDistributionSummery

      public org.infinispan.commons.stat.DistributionSummaryTracker createDistributionSummery(String metricName, String description, Map<String,String> tags, Consumer<Object> generatedId)
      Description copied from interface: HotRodClientMetricsRegistry
      Creates a sample distribution metric.

      It keeps track of the event's sample distribution.

      It can be used to create more complex statistics like histograms.

      The Hot Rod client uses the returned DistributionSummaryTracker to sample the events.

      Specified by:
      createDistributionSummery in interface HotRodClientMetricsRegistry
      Parameters:
      metricName - The metric name.
      description - A small description of the metrics to help explain what it measures.
      tags - Extra tags or information about the gauge (for example, cache name).
      generatedId - A Consumer to accept the generated ID. The ID will be used to unregister the metric on demand.
      Returns:
      The DistributionSummaryTracker implementation.
    • createGauge

      public void createGauge(String metricName, String description, Supplier<Number> gauge, Map<String,String> tags, Consumer<Object> generatedId)
      Description copied from interface: HotRodClientMetricsRegistry
      Creates a gauge metric.

      A gauge keeps track of a single value. For example, a connection pool size.

      Specified by:
      createGauge in interface HotRodClientMetricsRegistry
      Parameters:
      metricName - The metric name.
      description - A small description of the metrics to help explain what it measures.
      gauge - The Supplier to be invoked to get the current value.
      tags - Extra tags or information about the gauge (for example, cache name).
      generatedId - A Consumer to accept the generated ID. The ID will be used to unregister the metric on demand.
    • createTimeGauge

      public void createTimeGauge(String metricName, String description, Supplier<Number> gauge, TimeUnit timeUnit, Map<String,String> tags, Consumer<Object> generatedId)
      Description copied from interface: HotRodClientMetricsRegistry
      Creates a time gauge metric.

      A specialized gauge keeps track of a time value.

      Specified by:
      createTimeGauge in interface HotRodClientMetricsRegistry
      Parameters:
      metricName - The metric name.
      description - A small description of the metrics to help explain what it measures.
      gauge - The Supplier to be invoked to get the current value.
      timeUnit - The TimeUnit of the return value.
      tags - Extra tags or information about the gauge (for example, cache name).
      generatedId - A Consumer to accept the generated ID. The ID will be used to unregister the metric on demand.
    • createTimer

      public org.infinispan.commons.stat.TimerTracker createTimer(String metricName, String description, Map<String,String> tags, Consumer<Object> generatedId)
      Description copied from interface: HotRodClientMetricsRegistry
      Creates a timer metrics.

      A time keep track of the event's duration. For example, a request duration.

      It can be used to compute more complex statistics, like histograms and/or percentiles.

      The Hot Rod client uses the returned TimerTracker to register the event duration.

      Specified by:
      createTimer in interface HotRodClientMetricsRegistry
      Parameters:
      metricName - The metric name.
      description - A small description of the metrics to help explain what it measures.
      tags - Extra tags or information about the gauge (for example, cache name).
      Returns:
      A TimerTracker implementation.
    • close

      public void close()
      Description copied from interface: HotRodClientMetricsRegistry
      Unregister all metrics created.
      Specified by:
      close in interface HotRodClientMetricsRegistry
    • removeMetric

      public void removeMetric(Object id)
      Description copied from interface: HotRodClientMetricsRegistry
      Unregister a metric by its ID.
      Specified by:
      removeMetric in interface HotRodClientMetricsRegistry
      Parameters:
      id - The metric ID.
    • toString

      public String toString()
      Overrides:
      toString in class Object