public class InfluxdbReporter extends Object implements Scheduled
MetricReporter
that exports Metrics
via InfluxDB.Modifier and Type | Field and Description |
---|---|
protected Map<Counter,MetricInfo> |
counters |
protected Map<Gauge<?>,MetricInfo> |
gauges |
protected Map<Histogram,MetricInfo> |
histograms |
protected org.slf4j.Logger |
log |
protected Map<Meter,MetricInfo> |
meters |
protected org.apache.flink.metrics.influxdb.MetricInfoProvider<MetricInfo> |
metricInfoProvider |
Constructor and Description |
---|
InfluxdbReporter() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this reporter.
|
void |
notifyOfAddedMetric(Metric metric,
String metricName,
MetricGroup group)
Called when a new
Metric was added. |
void |
notifyOfRemovedMetric(Metric metric,
String metricName,
MetricGroup group)
Called when a
Metric was removed. |
void |
open(MetricConfig config)
Configures this reporter.
|
void |
report()
Report the current measurements.
|
protected final org.slf4j.Logger log
protected final org.apache.flink.metrics.influxdb.MetricInfoProvider<MetricInfo> metricInfoProvider
public void open(MetricConfig config)
MetricReporter
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.
open
in interface MetricReporter
config
- A properties object that contains all parameters set for this reporter.public void close()
MetricReporter
close
in interface MetricReporter
public void report()
Scheduled
public void notifyOfAddedMetric(Metric metric, String metricName, MetricGroup group)
MetricReporter
Metric
was added.notifyOfAddedMetric
in interface MetricReporter
metric
- the metric that was addedmetricName
- the name of the metricgroup
- the group that contains the metricpublic void notifyOfRemovedMetric(Metric metric, String metricName, MetricGroup group)
MetricReporter
Metric
was removed.notifyOfRemovedMetric
in interface MetricReporter
metric
- the metric that should be removedmetricName
- the name of the metricgroup
- the group that contains the metricCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.