Package org.wildfly.extension.metrics
Class WildFlyMetricRegistry
java.lang.Object
org.wildfly.extension.metrics.WildFlyMetricRegistry
- All Implemented Interfaces:
Closeable,AutoCloseable,MetricRegistry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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.
-
Constructor Details
-
WildFlyMetricRegistry
public WildFlyMetricRegistry()
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
registerMetric
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
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
-