Package org.wildfly.extension.metrics
Interface MetricRegistry
- All Known Implementing Classes:
WildFlyMetricRegistry
public interface MetricRegistry
Provides a registry of metrics.
-
Method Summary
Modifier and TypeMethodDescriptionvoidreadLock()Acquires a non-exclusive read lock that will cause calls from other threads toregisterMetric(Metric, MetricMetadata)orunregister(MetricID)to block.voidregisterMetric(Metric metric, MetricMetadata metadata) Registers the given metric.voidunlock()Releases the non-exclusive lock obtained by a call toreadLock().voidunregister(MetricID metricID) Unregisters the given metric, if it is registered.
-
Method Details
-
registerMetric
Registers the given metric. Calls will block if another threadholds the registry read lock.- Parameters:
metric- the metric. Cannot benullmetadata- metadata for the metric. Cannot benull
-
unregister
Unregisters the given metric, if it is registered. Calls will block if another threadholds the registry read lock.- Parameters:
metricID- the id for the metric. Cannot benull
-
readLock
void readLock()Acquires a non-exclusive read lock that will cause calls from other threads toregisterMetric(Metric, MetricMetadata)orunregister(MetricID)to block. Must be followed by a call tounlock(). -
unlock
void unlock()Releases the non-exclusive lock obtained by a call toreadLock().
-