flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] tillrohrmann commented on a change in pull request #8002: [FLINK-11923][metrics] MetricRegistryConfiguration provides MetricReporters Suppliers
Date Thu, 11 Apr 2019 08:30:43 GMT
tillrohrmann commented on a change in pull request #8002: [FLINK-11923][metrics] MetricRegistryConfiguration
provides MetricReporters Suppliers
URL: https://github.com/apache/flink/pull/8002#discussion_r274313355
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistryImpl.java
 ##########
 @@ -113,19 +114,12 @@ public MetricRegistryImpl(MetricRegistryConfiguration config) {
 			// by default, don't report anything
 			LOG.info("No metrics reporter configured, no metrics will be exposed/reported.");
 		} else {
-			// we have some reporters so
-			for (Tuple2<String, Configuration> reporterConfiguration: reporterConfigurations)
{
-				String namedReporter = reporterConfiguration.f0;
-				Configuration reporterConfig = reporterConfiguration.f1;
-
-				final String className = reporterConfig.getString(ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX,
null);
-				if (className == null) {
-					LOG.error("No reporter class set for reporter " + namedReporter + ". Metrics might not
be exposed/reported.");
-					continue;
-				}
+			for (ReporterSetup reporterSetup : reporterConfigurations) {
 
 Review comment:
   I'm not suggesting to add these explicit methods to the `MetricReporter` itself. Instead
one option could be (not insisting on this) that the `ReporterSetup` has the following methods
`#getReporter`, `#getName`, `#getInterval` and `#getScopeDelimiter` to encapsulate the `MetricConfig`.
Or one could have a decorator interface which adds these additional fields to the `MetricReporter`.
An implementation of this decorator interface could simply use the `MetricConfig` underneath
but testing implementations could directly implement such a reporter.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message