Package org.wildfly.extension.metrics
Interface MetricRegistry
-
- All Known Implementing Classes:
WildFlyMetricRegistry
public interface MetricRegistryProvides a registry of metrics.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidreadLock()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 Detail
-
registerMetric
void registerMetric(Metric metric, MetricMetadata metadata)
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
void unregister(MetricID metricID)
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().
-
-