Package org.apache.flink.metrics.slf4j
Class Slf4jReporter
- java.lang.Object
-
- org.apache.flink.metrics.reporter.AbstractReporter
-
- org.apache.flink.metrics.slf4j.Slf4jReporter
-
- All Implemented Interfaces:
CharacterFilter
,MetricReporter
,Scheduled
public class Slf4jReporter extends AbstractReporter implements Scheduled
-
-
Field Summary
-
Fields inherited from class org.apache.flink.metrics.reporter.AbstractReporter
counters, gauges, histograms, log, meters
-
Fields inherited from interface org.apache.flink.metrics.CharacterFilter
NO_OP_FILTER
-
-
Constructor Summary
Constructors Constructor Description Slf4jReporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this reporter.String
filterCharacters(String input)
Filter the given string and generate a resulting string from it.void
open(MetricConfig metricConfig)
Configures this reporter.void
report()
Report the current measurements.-
Methods inherited from class org.apache.flink.metrics.reporter.AbstractReporter
notifyOfAddedMetric, notifyOfRemovedMetric
-
-
-
-
Method Detail
-
open
public void open(MetricConfig metricConfig)
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:
metricConfig
- 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
-
report
public void report()
Description copied from interface:Scheduled
Report the current measurements. This method is called periodically by the metrics registry that uses the reporter. This method must not block for a significant amount of time, any reporter needing more time should instead run the operation asynchronously.
-
filterCharacters
public String filterCharacters(String input)
Description copied from interface:CharacterFilter
Filter the given string and generate a resulting string from it.For example, one implementation could filter out invalid characters from the input string.
- Specified by:
filterCharacters
in interfaceCharacterFilter
- Parameters:
input
- Input string- Returns:
- Filtered result string
-
-