org.apache.kafka.common.metrics
Class JmxReporter

java.lang.Object
  extended by org.apache.kafka.common.metrics.JmxReporter
All Implemented Interfaces:
Configurable, MetricsReporter

public class JmxReporter
extends java.lang.Object
implements MetricsReporter

Register metrics in JMX as dynamic mbeans based on the metric names


Constructor Summary
JmxReporter()
           
JmxReporter(java.lang.String prefix)
          Create a JMX reporter that prefixes all metrics with the given string.
 
Method Summary
 void close()
          Called when the metrics repository is closed.
 void configure(java.util.Map<java.lang.String,?> configs)
          Configure this class with the given key-value pairs
 void init(java.util.List<KafkaMetric> metrics)
          This is called when the reporter is first registered to initially register all existing metrics
 void metricChange(KafkaMetric metric)
          This is called whenever a metric is updated or added
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmxReporter

public JmxReporter()

JmxReporter

public JmxReporter(java.lang.String prefix)
Create a JMX reporter that prefixes all metrics with the given string.

Method Detail

configure

public void configure(java.util.Map<java.lang.String,?> configs)
Description copied from interface: Configurable
Configure this class with the given key-value pairs

Specified by:
configure in interface Configurable

init

public void init(java.util.List<KafkaMetric> metrics)
Description copied from interface: MetricsReporter
This is called when the reporter is first registered to initially register all existing metrics

Specified by:
init in interface MetricsReporter
Parameters:
metrics - All currently existing metrics

metricChange

public void metricChange(KafkaMetric metric)
Description copied from interface: MetricsReporter
This is called whenever a metric is updated or added

Specified by:
metricChange in interface MetricsReporter

close

public void close()
Description copied from interface: MetricsReporter
Called when the metrics repository is closed.

Specified by:
close in interface MetricsReporter