com.yammer.metrics.reporting
Class JmxReporter
java.lang.Object
com.yammer.metrics.reporting.AbstractReporter
com.yammer.metrics.reporting.JmxReporter
- All Implemented Interfaces:
- MetricsProcessor<JmxReporter.Context>, MetricsRegistryListener, EventListener
public class JmxReporter
- extends AbstractReporter
- implements MetricsRegistryListener, MetricsProcessor<JmxReporter.Context>
A reporter which exposes application metric as JMX MBeans.
|
Method Summary |
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,
CounterMetric counter,
JmxReporter.Context context)
|
void |
processGauge(MetricName name,
GaugeMetric<?> gauge,
JmxReporter.Context context)
|
void |
processHistogram(MetricName name,
HistogramMetric histogram,
JmxReporter.Context context)
|
void |
processMeter(MetricName name,
Metered meter,
JmxReporter.Context context)
|
void |
processTimer(MetricName name,
TimerMetric timer,
JmxReporter.Context context)
|
void |
shutdown()
Stops the reporter and closes any internal resources. |
static void |
shutdownDefault()
|
void |
start()
|
static void |
startDefault(MetricsRegistry defaultMetricsRegistry)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JmxReporter
public JmxReporter(MetricsRegistry metricsRegistry)
startDefault
public static void startDefault(MetricsRegistry defaultMetricsRegistry)
shutdownDefault
public static void shutdownDefault()
onMetricAdded
public void onMetricAdded(MetricName name,
Metric metric)
- Description copied from interface:
MetricsRegistryListener
- Called when a metric has been added to the
MetricsRegistry.
- Specified by:
onMetricAdded in interface MetricsRegistryListener
- Parameters:
name - the name of the Metricmetric - the Metric
processMeter
public void processMeter(MetricName name,
Metered meter,
JmxReporter.Context context)
throws Exception
- Specified by:
processMeter in interface MetricsProcessor<JmxReporter.Context>
- Throws:
Exception
processCounter
public void processCounter(MetricName name,
CounterMetric counter,
JmxReporter.Context context)
throws Exception
- Specified by:
processCounter in interface MetricsProcessor<JmxReporter.Context>
- Throws:
Exception
processHistogram
public void processHistogram(MetricName name,
HistogramMetric histogram,
JmxReporter.Context context)
throws Exception
- Specified by:
processHistogram in interface MetricsProcessor<JmxReporter.Context>
- Throws:
Exception
processTimer
public void processTimer(MetricName name,
TimerMetric timer,
JmxReporter.Context context)
throws Exception
- Specified by:
processTimer in interface MetricsProcessor<JmxReporter.Context>
- Throws:
Exception
processGauge
public void processGauge(MetricName name,
GaugeMetric<?> gauge,
JmxReporter.Context context)
throws Exception
- Specified by:
processGauge in interface MetricsProcessor<JmxReporter.Context>
- Throws:
Exception
onMetricRemoved
public void onMetricRemoved(MetricName name)
- Description copied from interface:
MetricsRegistryListener
- Called when a metric has been removed from the
MetricsRegistry.
- Specified by:
onMetricRemoved in interface MetricsRegistryListener
- Parameters:
name - the name of the Metric
start
public final void start()
shutdown
public void shutdown()
- Description copied from class:
AbstractReporter
- Stops the reporter and closes any internal resources.
- Overrides:
shutdown in class AbstractReporter
Copyright © 2011. All Rights Reserved.