public class MetricRegistry extends Object
Metrics
. It serves as the
connection between MetricGroups
and MetricReporters
.Constructor and Description |
---|
MetricRegistry(MetricRegistryConfiguration config)
Creates a new MetricRegistry and starts the configured reporter.
|
Modifier and Type | Method and Description |
---|---|
char |
getDelimiter()
Returns the global delimiter.
|
char |
getDelimiter(int reporterIndex)
Returns the configured delimiter for the reporter with the given index.
|
akka.actor.ActorRef |
getQueryService() |
List<MetricReporter> |
getReporters() |
ScopeFormats |
getScopeFormats() |
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 |
shutdown()
Shuts down this registry and the associated
MetricReporter . |
void |
startQueryService(akka.actor.ActorSystem actorSystem,
ResourceID resourceID)
Initializes the MetricQueryService.
|
void |
unregister(Metric metric,
String metricName,
AbstractMetricGroup group)
Un-registers the given
Metric with this registry. |
public MetricRegistry(MetricRegistryConfiguration config)
public void startQueryService(akka.actor.ActorSystem actorSystem, ResourceID resourceID)
actorSystem
- ActorSystem to create the MetricQueryService onresourceID
- resource ID used to disambiguate the actor namepublic char getDelimiter()
public char getDelimiter(int reporterIndex)
reporterIndex
- index of the reporter whose delimiter should be usedpublic List<MetricReporter> getReporters()
public boolean isShutdown()
public void shutdown()
MetricReporter
.public ScopeFormats getScopeFormats()
public void register(Metric metric, String metricName, AbstractMetricGroup group)
Metric
with this registry.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)
Metric
with this registry.metric
- the metric that should be removedmetricName
- the name of the metricgroup
- the group that contains the metric@VisibleForTesting public akka.actor.ActorRef getQueryService()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.