com.yammer.metrics.reporting
Class JmxReporter

java.lang.Object
  extended by com.yammer.metrics.reporting.AbstractReporter
      extended by 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.


Nested Class Summary
static class JmxReporter.AbstractBean
           
static class JmxReporter.Context
           
static class JmxReporter.Counter
           
static interface JmxReporter.CounterMBean
           
static class JmxReporter.Gauge
           
static interface JmxReporter.GaugeMBean
           
static class JmxReporter.Histogram
           
static interface JmxReporter.HistogramMBean
           
static class JmxReporter.Meter
           
static interface JmxReporter.MeterMBean
           
static interface JmxReporter.MetricMBean
           
static class JmxReporter.Timer
           
static interface JmxReporter.TimerMBean
           
 
Field Summary
 
Fields inherited from class com.yammer.metrics.reporting.AbstractReporter
metricsRegistry
 
Constructor Summary
JmxReporter(MetricsRegistry metricsRegistry)
           
 
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
 

Constructor Detail

JmxReporter

public JmxReporter(MetricsRegistry metricsRegistry)
Method Detail

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 Metric
metric - 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.