Package org.infinispan.metrics.impl
Class NoMetricRegistry
java.lang.Object
org.infinispan.metrics.impl.NoMetricRegistry
- All Implemented Interfaces:
Constants,MetricsRegistry
An empty implementation of
MetricsRegistry.
There is no registry in this instance and all the operations are no-ops. This instance is used when metrics are disabled globally.
-
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanregisterMetrics(Object instance, Collection<org.infinispan.commons.stat.MetricInfo> attributes, String namePrefix, Map<String, String> tags) Register theMBeanMetadata.AttributeMetadataas metrics.Prometheus like scrapping of the registered metrics.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
-
Method Details
-
registerMetrics
public Set<Object> registerMetrics(Object instance, Collection<org.infinispan.commons.stat.MetricInfo> attributes, String namePrefix, 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.attributes- The attribute (metrics) to be registered, if valid.namePrefix- 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.
-