public class MetricRegistryImpl extends Object implements MetricRegistry, AutoCloseableAsync
Metrics
. It serves as the
connection between MetricGroups
and MetricReporters
.Constructor and Description |
---|
MetricRegistryImpl(MetricRegistryConfiguration config) |
MetricRegistryImpl(MetricRegistryConfiguration config,
Collection<ReporterSetup> reporterConfigurations) |
MetricRegistryImpl(MetricRegistryConfiguration config,
Collection<ReporterSetup> reporterConfigurations,
Collection<TraceReporterSetup> traceReporterConfigurations)
Creates a new MetricRegistry and starts the configured reporter.
|
Modifier and Type | Method and Description |
---|---|
void |
addSpan(SpanBuilder spanBuilder)
Add and log a
Span . |
CompletableFuture<Void> |
closeAsync()
Shuts down this registry and the associated
MetricReporter . |
char |
getDelimiter()
Returns the global delimiter.
|
String |
getMetricQueryServiceGatewayRpcAddress()
Returns the address under which the
MetricQueryService is reachable. |
RpcService |
getMetricQueryServiceRpcService()
Returns the rpc service that the
MetricQueryService runs in. |
int |
getNumberReporters()
Returns the number of registered reporters.
|
List<MetricReporter> |
getReporters() |
ScopeFormats |
getScopeFormats()
Returns the scope formats.
|
boolean |
isShutdown()
Returns whether this registry has been shutdown.
|
void |
register(Metric metric,
String metricName,
AbstractMetricGroup group)
Registers a new
Metric with this registry. |
void |
startQueryService(RpcService rpcService,
ResourceID resourceID)
Initializes the MetricQueryService.
|
void |
unregister(Metric metric,
String metricName,
AbstractMetricGroup group)
Un-registers the given
Metric with this registry. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public MetricRegistryImpl(MetricRegistryConfiguration config)
public MetricRegistryImpl(MetricRegistryConfiguration config, Collection<ReporterSetup> reporterConfigurations)
public MetricRegistryImpl(MetricRegistryConfiguration config, Collection<ReporterSetup> reporterConfigurations, Collection<TraceReporterSetup> traceReporterConfigurations)
public void startQueryService(RpcService rpcService, ResourceID resourceID)
rpcService
- RpcService to create the MetricQueryService onresourceID
- resource ID used to disambiguate the actor name@Nullable public RpcService getMetricQueryServiceRpcService()
MetricQueryService
runs in.@Nullable public String getMetricQueryServiceGatewayRpcAddress()
MetricQueryService
is reachable.getMetricQueryServiceGatewayRpcAddress
in interface MetricRegistry
public char getDelimiter()
MetricRegistry
getDelimiter
in interface MetricRegistry
public int getNumberReporters()
MetricRegistry
getNumberReporters
in interface MetricRegistry
@VisibleForTesting public List<MetricReporter> getReporters()
public boolean isShutdown()
public CompletableFuture<Void> closeAsync()
MetricReporter
.
NOTE: This operation is asynchronous and returns a future which is completed once the shutdown operation has been completed.
closeAsync
in interface AutoCloseableAsync
MetricRegistryImpl
is shut down.public ScopeFormats getScopeFormats()
MetricRegistry
getScopeFormats
in interface MetricRegistry
public void addSpan(SpanBuilder spanBuilder)
MetricRegistry
Span
.addSpan
in interface MetricRegistry
public void register(Metric metric, String metricName, AbstractMetricGroup group)
MetricRegistry
Metric
with this registry.register
in interface MetricRegistry
metric
- the metric that was addedmetricName
- the name of the metricgroup
- the group that contains the metricpublic void unregister(Metric metric, String metricName, AbstractMetricGroup group)
MetricRegistry
Metric
with this registry.unregister
in interface MetricRegistry
metric
- the metric that should be removedmetricName
- the name of the metricgroup
- the group that contains the metricCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.