Package org.wildfly.extension.metrics
Class WildFlyMetricRegistry
- java.lang.Object
-
- org.wildfly.extension.metrics.WildFlyMetricRegistry
-
- All Implemented Interfaces:
Closeable,AutoCloseable,MetricRegistry
public class WildFlyMetricRegistry extends Object implements Closeable, MetricRegistry
-
-
Constructor Summary
Constructors Constructor Description WildFlyMetricRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidreadLock()Acquires a non-exclusive read lock that will cause calls from other threads toMetricRegistry.registerMetric(Metric, MetricMetadata)orMetricRegistry.unregister(MetricID)to block.voidregisterMetric(Metric metric, MetricMetadata metadata)Registers the given metric.voidunlock()Releases the non-exclusive lock obtained by a call toMetricRegistry.readLock().voidunregister(MetricID metricID)Unregisters the given metric, if it is registered.
-
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
registerMetric
public void registerMetric(Metric metric, MetricMetadata metadata)
Description copied from interface:MetricRegistryRegisters the given metric. Calls will block if another threadholds the registry read lock.- Specified by:
registerMetricin interfaceMetricRegistry- Parameters:
metric- the metric. Cannot benullmetadata- metadata for the metric. Cannot benull
-
unregister
public void unregister(MetricID metricID)
Description copied from interface:MetricRegistryUnregisters the given metric, if it is registered. Calls will block if another threadholds the registry read lock.- Specified by:
unregisterin interfaceMetricRegistry- Parameters:
metricID- the id for the metric. Cannot benull
-
readLock
public void readLock()
Description copied from interface:MetricRegistryAcquires a non-exclusive read lock that will cause calls from other threads toMetricRegistry.registerMetric(Metric, MetricMetadata)orMetricRegistry.unregister(MetricID)to block. Must be followed by a call toMetricRegistry.unlock().- Specified by:
readLockin interfaceMetricRegistry
-
unlock
public void unlock()
Description copied from interface:MetricRegistryReleases the non-exclusive lock obtained by a call toMetricRegistry.readLock().- Specified by:
unlockin interfaceMetricRegistry
-
-