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.Closeable
A reporter which listens for new metrics and exposes them as namespaced MBeans.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
JmxReporter.AbstractBean
static class
JmxReporter.Builder
A builder forCsvReporter
instances.private static class
JmxReporter.JmxCounter
static interface
JmxReporter.JmxCounterMBean
private static class
JmxReporter.JmxGauge
static interface
JmxReporter.JmxGaugeMBean
private static class
JmxReporter.JmxHistogram
static interface
JmxReporter.JmxHistogramMBean
private static class
JmxReporter.JmxListener
private static class
JmxReporter.JmxMeter
static interface
JmxReporter.JmxMeterMBean
(package private) static class
JmxReporter.JmxTimer
static interface
JmxReporter.JmxTimerMBean
static interface
JmxReporter.MetricMBean
private static class
JmxReporter.MetricTimeUnits
-
Field Summary
Fields Modifier and Type Field Description private JmxReporter.JmxListener
listener
private static org.slf4j.Logger
LOGGER
private MetricRegistry
registry
-
Constructor Summary
Constructors Modifier Constructor Description private
JmxReporter(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 void
close()
Stops the reporter.static JmxReporter.Builder
forRegistry(MetricRegistry registry)
Returns a newJmxReporter.Builder
forJmxReporter
.void
start()
Starts the reporter.void
stop()
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.Builder
forJmxReporter
.- Parameters:
registry
- the registry to report- Returns:
- a
JmxReporter.Builder
instance 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-