Package org.apache.flink.metrics.jmx
Class JMXReporter
- java.lang.Object
-
- org.apache.flink.metrics.jmx.JMXReporter
-
- All Implemented Interfaces:
MetricReporter
public class JMXReporter extends Object implements MetricReporter
MetricReporter
that exportsMetrics
via JMX.Largely based on the JmxReporter class of the dropwizard metrics library https://github.com/dropwizard/metrics/blob/master/metrics-core/src/main/java/io/dropwizard/metrics/JmxReporter.java
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
JMXReporter.JmxCounterMBean
The MBean interface for an exposed counter.static interface
JMXReporter.JmxGaugeMBean
The MBean interface for an exposed gauge.static interface
JMXReporter.JmxHistogramMBean
The MBean interface for an exposed histogram.static interface
JMXReporter.JmxMeterMBean
The MBean interface for an exposed meter.static interface
JMXReporter.MetricMBean
The common MBean interface for all metrics.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this reporter.Optional<Integer>
getPort()
void
notifyOfAddedMetric(Metric metric, String metricName, MetricGroup group)
Called when a newMetric
was added.void
notifyOfRemovedMetric(Metric metric, String metricName, MetricGroup group)
Called when aMetric
was removed.void
open(MetricConfig config)
Configures this reporter.
-
-
-
Method Detail
-
open
public void open(MetricConfig config)
Description copied from interface:MetricReporter
Configures this reporter.If the reporter was instantiated generically and hence parameter-less, this method is the place where the reporter sets it's basic fields based on configuration values. Otherwise, this method will typically be a no-op since resources can be acquired in the constructor.
This method is always called first on a newly instantiated reporter.
- Specified by:
open
in interfaceMetricReporter
- Parameters:
config
- A properties object that contains all parameters set for this reporter.
-
close
public void close()
Description copied from interface:MetricReporter
Closes this reporter. Should be used to close channels, streams and release resources.- Specified by:
close
in interfaceMetricReporter
-
notifyOfAddedMetric
public void notifyOfAddedMetric(Metric metric, String metricName, MetricGroup group)
Description copied from interface:MetricReporter
Called when a newMetric
was added.- Specified by:
notifyOfAddedMetric
in interfaceMetricReporter
- Parameters:
metric
- the metric that was addedmetricName
- the name of the metricgroup
- the group that contains the metric
-
notifyOfRemovedMetric
public void notifyOfRemovedMetric(Metric metric, String metricName, MetricGroup group)
Description copied from interface:MetricReporter
Called when aMetric
was removed.- Specified by:
notifyOfRemovedMetric
in interfaceMetricReporter
- Parameters:
metric
- the metric that should be removedmetricName
- the name of the metricgroup
- the group that contains the metric
-
-