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
Modifier and TypeClassDescriptionstatic class
Creates a newMicrometerRemoteCacheManagerMetricsRegistry
instance. -
Field Summary
Fields inherited from interface org.infinispan.client.hotrod.metrics.RemoteCacheManagerMetricsRegistry
DISABLED
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
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.void
createGauge
(String metricName, String description, Supplier<Number> gauge, Map<String, String> tags, Consumer<Object> generatedId) Creates a gauge metric.void
createTimeGauge
(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.void
removeCache
(String cacheName) Removes and unregister all cache related metrics.void
removeMetric
(Object id) Unregister a metric by its ID.toString()
Returns aHotRodClientMetricsRegistry
to be used to register a remote cache metrics.
-
Method Details
-
withCache
Description copied from interface:RemoteCacheManagerMetricsRegistry
Returns aHotRodClientMetricsRegistry
to be used to register a remote cache metrics.- Specified by:
withCache
in interfaceRemoteCacheManagerMetricsRegistry
- Parameters:
cacheName
- The cache's name.- Returns:
- The
HotRodClientMetricsRegistry
implementation to use.
-
removeCache
Description copied from interface:RemoteCacheManagerMetricsRegistry
Removes and unregister all cache related metrics.- Specified by:
removeCache
in 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: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 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
- AConsumer
to accept the generated ID. The ID will be used to unregister the metric on demand.- Returns:
- The
CounterTracker
implementation.
-
createDistributionSummery
public 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 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
- AConsumer
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 interfaceHotRodClientMetricsRegistry
- Parameters:
metricName
- The metric name.description
- A small description of the metrics to help explain what it measures.gauge
- TheSupplier
to be invoked to get the current value.tags
- Extra tags or information about the gauge (for example, cache name).generatedId
- AConsumer
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 interfaceHotRodClientMetricsRegistry
- Parameters:
metricName
- The metric name.description
- A small description of the metrics to help explain what it measures.gauge
- TheSupplier
to be invoked to get the current value.timeUnit
- TheTimeUnit
of the return value.tags
- Extra tags or information about the gauge (for example, cache name).generatedId
- AConsumer
to 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: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 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
TimerTracker
implementation.
-
close
public void close()Description copied from interface:HotRodClientMetricsRegistry
Unregister all metrics created.- Specified by:
close
in interfaceHotRodClientMetricsRegistry
-
removeMetric
Description copied from interface:HotRodClientMetricsRegistry
Unregister a metric by its ID.- Specified by:
removeMetric
in interfaceHotRodClientMetricsRegistry
- Parameters:
id
- The metric ID.
-
toString
-