Package com.codahale.metrics
Class JmxReporter
- java.lang.Object
-
- com.codahale.metrics.JmxReporter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class JmxReporter extends java.lang.Object implements java.io.CloseableA reporter which listens for new metrics and exposes them as namespaced MBeans.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classJmxReporter.AbstractBeanstatic classJmxReporter.BuilderA builder forCsvReporterinstances.private static classJmxReporter.JmxCounterstatic interfaceJmxReporter.JmxCounterMBeanprivate static classJmxReporter.JmxGaugestatic interfaceJmxReporter.JmxGaugeMBeanprivate static classJmxReporter.JmxHistogramstatic interfaceJmxReporter.JmxHistogramMBeanprivate static classJmxReporter.JmxListenerprivate static classJmxReporter.JmxMeterstatic interfaceJmxReporter.JmxMeterMBean(package private) static classJmxReporter.JmxTimerstatic interfaceJmxReporter.JmxTimerMBeanstatic interfaceJmxReporter.MetricMBeanprivate static classJmxReporter.MetricTimeUnits
-
Field Summary
Fields Modifier and Type Field Description private JmxReporter.JmxListenerlistenerprivate static org.slf4j.LoggerLOGGERprivate MetricRegistryregistry
-
Constructor Summary
Constructors Modifier Constructor Description privateJmxReporter(javax.management.MBeanServer mBeanServer, java.lang.String domain, MetricRegistry registry, MetricFilter filter, JmxReporter.MetricTimeUnits timeUnits)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Stops the reporter.static JmxReporter.BuilderforRegistry(MetricRegistry registry)Returns a newJmxReporter.BuilderforJmxReporter.voidstart()Starts the reporter.voidstop()Stops the reporter.
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
registry
private final MetricRegistry registry
-
listener
private final JmxReporter.JmxListener listener
-
-
Constructor Detail
-
JmxReporter
private JmxReporter(javax.management.MBeanServer mBeanServer, java.lang.String domain, MetricRegistry registry, MetricFilter filter, JmxReporter.MetricTimeUnits timeUnits)
-
-
Method Detail
-
forRegistry
public static JmxReporter.Builder forRegistry(MetricRegistry registry)
Returns a newJmxReporter.BuilderforJmxReporter.- Parameters:
registry- the registry to report- Returns:
- a
JmxReporter.Builderinstance for aJmxReporter
-
start
public void start()
Starts the reporter.
-
stop
public void stop()
Stops the reporter.
-
close
public void close()
Stops the reporter.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-