@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public interface MetricRegistry extends MetricSet
Modifier and Type | Method and Description |
---|---|
Counter |
counter(String name)
Get or construct a
Counter used to track a mutable number. |
Optional<Metric> |
get(String name)
Returns previously registered metric with the name if any.
|
MetricRegistryInfo |
getMetricRegistryInfo()
Return the MetricRegistryInfo object for this registry.
|
Histogram |
histogram(String name)
Get or construct a
Histogram used to measure a distribution of values. |
Meter |
meter(String name)
|
<T> Gauge<T> |
register(String name,
Gauge<T> gauge)
Register a
Gauge . |
Metric |
register(String name,
Metric metric)
Registers the
Metric with the given name if there does not exist one with the same
name. |
void |
registerAll(MetricSet metricSet)
Registers the
Metric s in the given MetricSet. |
boolean |
remove(String name)
Removes the metric with the given name.
|
Timer |
timer(String name)
Get or construct a
Timer used to measure durations and report rates. |
getMetrics
Timer timer(String name)
Timer
used to measure durations and report rates.name
- the name of the timer.Timer
.Histogram histogram(String name)
Histogram
used to measure a distribution of values.name
- The name of the Histogram.Histogram
.Meter meter(String name)
Meter
used to measure durations and report distributions (a
combination of a Timer
and a Histogram
.name
- The name of the Meter.Meter
.Counter counter(String name)
Counter
used to track a mutable number.name
- The name of the CounterCounter
.<T> Gauge<T> register(String name, Gauge<T> gauge)
Gauge
. The Gauge will be invoked at a period defined by the implementation
of MetricRegistry
.name
- The name of the Gauge.gauge
- A callback to compute the current value.Metric register(String name, Metric metric)
Metric
with the given name if there does not exist one with the same
name. Returns the newly registered or existing Metric.name
- The name of the Metric.metric
- the metric to registervoid registerAll(MetricSet metricSet)
Metric
s in the given MetricSet.metricSet
- set of metrics to register.Optional<Metric> get(String name)
name
- the name of the metricboolean remove(String name)
name
- the name of the metric@InterfaceAudience.Private MetricRegistryInfo getMetricRegistryInfo()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.