public class MetricRegistryMetricReader extends Object implements MetricReader, com.codahale.metrics.MetricRegistryListener
MetricReader
that reads metrics from a Dropwizard
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(com.codahale.metrics.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,
com.codahale.metrics.Counter counter) |
void |
onCounterRemoved(String name) |
void |
onGaugeAdded(String name,
com.codahale.metrics.Gauge<?> gauge) |
void |
onGaugeRemoved(String name) |
void |
onHistogramAdded(String name,
com.codahale.metrics.Histogram histogram) |
void |
onHistogramRemoved(String name) |
void |
onMeterAdded(String name,
com.codahale.metrics.Meter meter) |
void |
onMeterRemoved(String name) |
void |
onTimerAdded(String name,
com.codahale.metrics.Timer timer) |
void |
onTimerRemoved(String name) |
public MetricRegistryMetricReader(com.codahale.metrics.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, com.codahale.metrics.Gauge<?> gauge)
onGaugeAdded
in interface com.codahale.metrics.MetricRegistryListener
public void onGaugeRemoved(String name)
onGaugeRemoved
in interface com.codahale.metrics.MetricRegistryListener
public void onCounterAdded(String name, com.codahale.metrics.Counter counter)
onCounterAdded
in interface com.codahale.metrics.MetricRegistryListener
public void onCounterRemoved(String name)
onCounterRemoved
in interface com.codahale.metrics.MetricRegistryListener
public void onHistogramAdded(String name, com.codahale.metrics.Histogram histogram)
onHistogramAdded
in interface com.codahale.metrics.MetricRegistryListener
public void onHistogramRemoved(String name)
onHistogramRemoved
in interface com.codahale.metrics.MetricRegistryListener
public void onMeterAdded(String name, com.codahale.metrics.Meter meter)
onMeterAdded
in interface com.codahale.metrics.MetricRegistryListener
public void onMeterRemoved(String name)
onMeterRemoved
in interface com.codahale.metrics.MetricRegistryListener
public void onTimerAdded(String name, com.codahale.metrics.Timer timer)
onTimerAdded
in interface com.codahale.metrics.MetricRegistryListener
public void onTimerRemoved(String name)
onTimerRemoved
in interface com.codahale.metrics.MetricRegistryListener
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.