public class JmxReporter extends AbstractReporter implements MetricsRegistryListener, MetricProcessor<com.yammer.metrics.reporting.JmxReporter.Context>
| Modifier and Type | Class and Description |
|---|---|
static interface |
JmxReporter.CounterMBean |
static interface |
JmxReporter.GaugeMBean |
static interface |
JmxReporter.HistogramMBean |
static interface |
JmxReporter.MeterMBean |
static interface |
JmxReporter.MetricMBean |
static interface |
JmxReporter.TimerMBean |
| Constructor and Description |
|---|
JmxReporter(MetricsRegistry registry)
Creates a new
JmxReporter for the given registry. |
| Modifier and Type | Method and Description |
|---|---|
void |
onMetricAdded(MetricName name,
Metric metric)
Called when a metric has been added to the
MetricsRegistry. |
void |
onMetricRemoved(MetricName name)
Called when a metric has been removed from the
MetricsRegistry. |
void |
processCounter(MetricName name,
Counter counter,
com.yammer.metrics.reporting.JmxReporter.Context context)
Process the given counter.
|
void |
processGauge(MetricName name,
Gauge<?> gauge,
com.yammer.metrics.reporting.JmxReporter.Context context)
Process the given gauge.
|
void |
processHistogram(MetricName name,
Histogram histogram,
com.yammer.metrics.reporting.JmxReporter.Context context)
Process the given histogram.
|
void |
processMeter(MetricName name,
Metered meter,
com.yammer.metrics.reporting.JmxReporter.Context context)
Process the given
Metered instance. |
void |
processTimer(MetricName name,
Timer timer,
com.yammer.metrics.reporting.JmxReporter.Context context)
Process the given timer.
|
void |
shutdown()
Stops the reporter and closes any internal resources.
|
static void |
shutdownDefault()
Stops the default instance of
JmxReporter. |
void |
start()
Starts the reporter.
|
static void |
startDefault(MetricsRegistry registry)
Starts the default instance of
JmxReporter. |
getMetricsRegistrypublic JmxReporter(MetricsRegistry registry)
JmxReporter for the given registry.registry - a MetricsRegistrypublic static void startDefault(MetricsRegistry registry)
JmxReporter.registry - the MetricsRegistry to report frompublic static void shutdownDefault()
JmxReporter.public void onMetricAdded(MetricName name, Metric metric)
MetricsRegistryListenerMetricsRegistry.onMetricAdded in interface MetricsRegistryListenername - the name of the Metricmetric - the Metricpublic void onMetricRemoved(MetricName name)
MetricsRegistryListenerMetricsRegistry.onMetricRemoved in interface MetricsRegistryListenername - the name of the Metricpublic void processMeter(MetricName name, Metered meter, com.yammer.metrics.reporting.JmxReporter.Context context) throws Exception
MetricProcessorMetered instance.processMeter in interface MetricProcessor<com.yammer.metrics.reporting.JmxReporter.Context>name - the name of the metermeter - the metercontext - the context of the meterException - if something goes wrongpublic void processCounter(MetricName name, Counter counter, com.yammer.metrics.reporting.JmxReporter.Context context) throws Exception
MetricProcessorprocessCounter in interface MetricProcessor<com.yammer.metrics.reporting.JmxReporter.Context>name - the name of the countercounter - the countercontext - the context of the meterException - if something goes wrongpublic void processHistogram(MetricName name, Histogram histogram, com.yammer.metrics.reporting.JmxReporter.Context context) throws Exception
MetricProcessorprocessHistogram in interface MetricProcessor<com.yammer.metrics.reporting.JmxReporter.Context>name - the name of the histogramhistogram - the histogramcontext - the context of the meterException - if something goes wrongpublic void processTimer(MetricName name, Timer timer, com.yammer.metrics.reporting.JmxReporter.Context context) throws Exception
MetricProcessorprocessTimer in interface MetricProcessor<com.yammer.metrics.reporting.JmxReporter.Context>name - the name of the timertimer - the timercontext - the context of the meterException - if something goes wrongpublic void processGauge(MetricName name, Gauge<?> gauge, com.yammer.metrics.reporting.JmxReporter.Context context) throws Exception
MetricProcessorprocessGauge in interface MetricProcessor<com.yammer.metrics.reporting.JmxReporter.Context>name - the name of the gaugegauge - the gaugecontext - the context of the meterException - if something goes wrongpublic void shutdown()
AbstractReportershutdown in class AbstractReporterpublic final void start()
Copyright © 2012. All Rights Reserved.