public class NoopMetricsSystem extends Object implements MetricsSystem
MetricsSystem
implementation which does nothing. Returns Metric
implementations
which also does nothing (avoiding null instances).Modifier and Type | Method and Description |
---|---|
Counter |
getCounter(String name)
Get or construct a
Counter used to track a mutable number. |
Histogram |
getHistogram(String name)
Get or construct a
Histogram used to measure a distribution of values. |
static NoopMetricsSystem |
getInstance() |
Meter |
getMeter(String name)
|
Timer |
getTimer(String name)
Get or construct a
Timer used to measure durations and report rates. |
<T> void |
register(String name,
Gauge<T> gauge)
Register a
Gauge . |
public static NoopMetricsSystem getInstance()
NoopMetricsSystem
instance.public Timer getTimer(String name)
MetricsSystem
Timer
used to measure durations and report rates.getTimer
in interface MetricsSystem
name
- The name of the Timer.Timer
.public Histogram getHistogram(String name)
MetricsSystem
Histogram
used to measure a distribution of values.getHistogram
in interface MetricsSystem
name
- The name of the Histogram.Histogram
.public Meter getMeter(String name)
MetricsSystem
Meter
used to measure durations and report distributions (a
combination of a Timer
and a Histogram
.getMeter
in interface MetricsSystem
name
- The name of the Meter.Meter
.public Counter getCounter(String name)
MetricsSystem
Counter
used to track a mutable number.getCounter
in interface MetricsSystem
name
- The name of the CounterCounter
.public <T> void register(String name, Gauge<T> gauge)
MetricsSystem
Gauge
. The Gauge will be invoked at a period defined by the implementation
of MetricsSystem
.register
in interface MetricsSystem
T
- The type of the Gauge.name
- The name of the Gauge.gauge
- A callback to compute the current value.Copyright © 2012-2024 Apache Software Foundation. All Rights Reserved.