public class MetricRegistryMetricReader extends Object implements MetricReader
MetricReader
that reads metrics from a Codahale
MetricRegistry
. Gauges and Counters are reflected as a single value. Timers,
Meters and Histograms are expanded into sets of metrics containing all the properties
of type Number.Constructor and Description |
---|
MetricRegistryMetricReader(MetricRegistry registry) |
Modifier and Type | Method and Description |
---|---|
long |
count()
The number of metrics known to this reader.
|
Iterable<Metric<?>> |
findAll()
Find all the metrics known to this reader.
|
Metric<?> |
findOne(String metricName)
Find an instance of the metric with the given name (usually the latest recorded
value).
|
void |
onCounterAdded(String name,
Counter counter) |
void |
onCounterRemoved(String name) |
void |
onGaugeAdded(String name,
|
void |
onGaugeRemoved(String name) |
void |
onHistogramAdded(String name,
Histogram histogram) |
void |
onHistogramRemoved(String name) |
void |
onMeterAdded(String name,
Meter meter) |
void |
onMeterRemoved(String name) |
void |
onTimerAdded(String name,
Timer timer) |
void |
onTimerRemoved(String name) |
public MetricRegistryMetricReader(MetricRegistry registry)
public Metric<?> findOne(String metricName)
MetricReader
findOne
in interface MetricReader
metricName
- the name of the metric to findpublic Iterable<Metric<?>> findAll()
MetricReader
findAll
in interface MetricReader
public long count()
MetricReader
count
in interface MetricReader
public void onGaugeAdded(String name,gauge)
public void onGaugeRemoved(String name)
public void onCounterAdded(String name, Counter counter)
public void onCounterRemoved(String name)
public void onHistogramAdded(String name, Histogram histogram)
public void onHistogramRemoved(String name)
public void onMeterAdded(String name, Meter meter)
public void onMeterRemoved(String name)
public void onTimerAdded(String name, Timer timer)
public void onTimerRemoved(String name)
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.