Package org.infinispan.metrics.impl
Class MetricsRegistryImpl
java.lang.Object
org.infinispan.metrics.impl.MetricsRegistryImpl
- All Implemented Interfaces:
Constants,MetricsRegistry
Concrete implementation of
MetricsRegistry.
It uses MeterRegistry from micrometer. It can use the instance configured from
MicrometerMeterRegistryConfiguration.meterRegistry() or, if not configured, it instantiates
PrometheusMeterRegistry.
-
Field Summary
Fields inherited from interface org.infinispan.metrics.Constants
CACHE_MANAGER_TAG_NAME, CACHE_TAG_NAME, JGROUPS_CLUSTER_TAG_NAME, JGROUPS_PREFIX, NODE_TAG_NAME, SITE_TAG_NAME, TARGET_NODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanregisterMetrics(Object instance, Collection<org.infinispan.commons.stat.MetricInfo> metricInfos, String prefix, Map<String, String> tags) Register theMBeanMetadata.AttributeMetadataas metrics.io.micrometer.core.instrument.MeterRegistryregistry()Prometheus like scrapping of the registered metrics.voidstart()voidstop()booleanIf this instance supports scrapping.voidunregisterMetric(Object metricId) Unregisters a single metric.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.metrics.impl.MetricsRegistry
unregisterMetrics
-
Constructor Details
-
MetricsRegistryImpl
public MetricsRegistryImpl()
-
-
Method Details
-
start
public void start() -
stop
public void stop() -
registerMetrics
public Set<Object> registerMetrics(Object instance, Collection<org.infinispan.commons.stat.MetricInfo> metricInfos, String prefix, Map<String, String> tags) Description copied from interface:MetricsRegistryRegister theMBeanMetadata.AttributeMetadataas metrics.- Specified by:
registerMetricsin interfaceMetricsRegistry- Parameters:
instance- The instance from where metrics are collected.metricInfos- The attribute (metrics) to be registered, if valid.prefix- The prefix or the component name.tags- Extra tags to be attached to the metrics.- Returns:
- A set of ids that can be used by
MetricsRegistry.unregisterMetric(Object)orMetricsRegistry.unregisterMetrics(Collection).
-
unregisterMetric
Description copied from interface:MetricsRegistryUnregisters a single metric.If the
metricIdis not a valid id, this method does nothing.- Specified by:
unregisterMetricin interfaceMetricsRegistry- Parameters:
metricId- The metric id as returned byMetricsRegistry.registerMetrics(Object, Collection, String, Map).
-
namesAsTags
public boolean namesAsTags()Description copied from interface:MetricsRegistry- Specified by:
namesAsTagsin interfaceMetricsRegistry- Returns:
trueif it should use tags to identify the cluster, site or cache manager name.
-
supportScrape
public boolean supportScrape()Description copied from interface:MetricsRegistryIf this instance supports scrapping.- Specified by:
supportScrapein interfaceMetricsRegistry- Returns:
trueif it supports Prometheus scrapping.- See Also:
-
scrape
Description copied from interface:MetricsRegistryPrometheus like scrapping of the registered metrics.It returns
nullifMetricsRegistry.supportScrape()returnsfalse.- Specified by:
scrapein interfaceMetricsRegistry- Parameters:
contentType- A valid content-type.- Returns:
- A
Stringwith the metrics values.
-
registry
public io.micrometer.core.instrument.MeterRegistry registry()
-