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 | Field and Description |
|---|---|
private static Counter |
COUNTER |
private static Histogram |
HISTOGRAM |
private static Meter |
METER |
private static NoopMetricsSystem |
NOOP_METRICS |
private static Timer |
TIMER |
| Modifier | Constructor and Description |
|---|---|
private |
NoopMetricsSystem() |
| 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. |
private static final NoopMetricsSystem NOOP_METRICS
private static final Timer TIMER
private static final Histogram HISTOGRAM
private static final Meter METER
private static final Counter COUNTER
public static NoopMetricsSystem getInstance()
NoopMetricsSystem instance.public Timer getTimer(String name)
MetricsSystemTimer used to measure durations and report rates.getTimer in interface MetricsSystemname - The name of the Timer.Timer.public Histogram getHistogram(String name)
MetricsSystemHistogram used to measure a distribution of values.getHistogram in interface MetricsSystemname - The name of the Histogram.Histogram.public Meter getMeter(String name)
MetricsSystemMeter used to measure durations and report distributions (a
combination of a Timer and a Histogram.getMeter in interface MetricsSystemname - The name of the Meter.Meter.public Counter getCounter(String name)
MetricsSystemCounter used to track a mutable number.getCounter in interface MetricsSystemname - The name of the CounterCounter.public <T> void register(String name, Gauge<T> gauge)
MetricsSystemGauge. The Gauge will be invoked at a period defined by the implementation
of MetricsSystem.register in interface MetricsSystemname - The name of the Gauge.gauge - A callback to compute the current value.Copyright © 2012–2016 The Apache Software Foundation. All rights reserved.