Class MicrometerRemoteCacheManagerMetricsRegistry
- All Implemented Interfaces:
HotRodClientMetricsRegistry,RemoteCacheManagerMetricsRegistry
RemoteCacheManagerMetricsRegistry implementation that uses Micrometer to register and expose metrics.
This class is instantiated using the MicrometerRemoteCacheManagerMetricsRegistry.Builder class.
- Since:
- 15.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCreates a newMicrometerRemoteCacheManagerMetricsRegistryinstance. -
Field Summary
Fields inherited from interface org.infinispan.client.hotrod.metrics.RemoteCacheManagerMetricsRegistry
DISABLED -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Unregister all metrics created.createCounter(String metricName, String description, Map<String, String> tags, Consumer<Object> generatedId) Create a counter metric.createDistributionSummery(String metricName, String description, Map<String, String> tags, Consumer<Object> generatedId) Creates a sample distribution metric.voidcreateGauge(String metricName, String description, Supplier<Number> gauge, Map<String, String> tags, Consumer<Object> generatedId) Creates a gauge metric.voidcreateTimeGauge(String metricName, String description, Supplier<Number> gauge, TimeUnit timeUnit, Map<String, String> tags, Consumer<Object> generatedId) Creates a time gauge metric.createTimer(String metricName, String description, Map<String, String> tags, Consumer<Object> generatedId) Creates a timer metrics.voidremoveCache(String cacheName) Removes and unregister all cache related metrics.voidremoveMetric(Object id) Unregister a metric by its ID.toString()Returns aHotRodClientMetricsRegistryto be used to register a remote cache metrics.
-
Method Details
-
withCache
Description copied from interface:RemoteCacheManagerMetricsRegistryReturns aHotRodClientMetricsRegistryto be used to register a remote cache metrics.- Specified by:
withCachein interfaceRemoteCacheManagerMetricsRegistry- Parameters:
cacheName- The cache's name.- Returns:
- The
HotRodClientMetricsRegistryimplementation to use.
-
removeCache
Description copied from interface:RemoteCacheManagerMetricsRegistryRemoves and unregister all cache related metrics.- Specified by:
removeCachein interfaceRemoteCacheManagerMetricsRegistry- Parameters:
cacheName- The cache's name.
-
createCounter
public CounterTracker createCounter(String metricName, String description, Map<String, String> tags, Consumer<Object> generatedId) Description copied from interface:HotRodClientMetricsRegistryCreate 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
CounterTrackerto update the counter.- Specified by:
createCounterin interfaceHotRodClientMetricsRegistry- 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- AConsumerto accept the generated ID. The ID will be used to unregister the metric on demand.- Returns:
- The
CounterTrackerimplementation.
-
createDistributionSummery
public DistributionSummaryTracker createDistributionSummery(String metricName, String description, Map<String, String> tags, Consumer<Object> generatedId) Description copied from interface:HotRodClientMetricsRegistryCreates 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
DistributionSummaryTrackerto sample the events.- Specified by:
createDistributionSummeryin interfaceHotRodClientMetricsRegistry- 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- AConsumerto accept the generated ID. The ID will be used to unregister the metric on demand.- Returns:
- The
DistributionSummaryTrackerimplementation.
-
createGauge
public void createGauge(String metricName, String description, Supplier<Number> gauge, Map<String, String> tags, Consumer<Object> generatedId) Description copied from interface:HotRodClientMetricsRegistryCreates a gauge metric.A gauge keeps track of a single value. For example, a connection pool size.
- Specified by:
createGaugein interfaceHotRodClientMetricsRegistry- Parameters:
metricName- The metric name.description- A small description of the metrics to help explain what it measures.gauge- TheSupplierto be invoked to get the current value.tags- Extra tags or information about the gauge (for example, cache name).generatedId- AConsumerto 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:HotRodClientMetricsRegistryCreates a time gauge metric.A specialized gauge keeps track of a time value.
- Specified by:
createTimeGaugein interfaceHotRodClientMetricsRegistry- Parameters:
metricName- The metric name.description- A small description of the metrics to help explain what it measures.gauge- TheSupplierto be invoked to get the current value.timeUnit- TheTimeUnitof the return value.tags- Extra tags or information about the gauge (for example, cache name).generatedId- AConsumerto accept the generated ID. The ID will be used to unregister the metric on demand.
-
createTimer
public TimerTracker createTimer(String metricName, String description, Map<String, String> tags, Consumer<Object> generatedId) Description copied from interface:HotRodClientMetricsRegistryCreates 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
TimerTrackerto register the event duration.- Specified by:
createTimerin interfaceHotRodClientMetricsRegistry- 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
TimerTrackerimplementation.
-
close
public void close()Description copied from interface:HotRodClientMetricsRegistryUnregister all metrics created.- Specified by:
closein interfaceHotRodClientMetricsRegistry
-
removeMetric
Description copied from interface:HotRodClientMetricsRegistryUnregister a metric by its ID.- Specified by:
removeMetricin interfaceHotRodClientMetricsRegistry- Parameters:
id- The metric ID.
-
toString
-