tillrohrmann commented on a change in pull request #10466: 
[FLINK-15110][metrics] Support variable exclusion
URL: https://github.com/apache/flink/pull/10466#discussion_r354934698
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/metrics/ReporterSetupTest.java
 ##########
 @@ -219,6 +222,21 @@ private static void 
assertReporter2Configured(ReporterSetup setup) {
                Assert.assertEquals(TestReporter2.class.getName(), 
setup.getConfiguration().getString("class", null));
        }
 
+       @Test
+       public void testVariableExclusionParsing() throws Exception {
+               final Configuration config = new Configuration();
+               config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + 
"test." + ConfigConstants.METRICS_REPORTER_FACTORY_CLASS_SUFFIX, 
TestReporterFactory.class.getName());
+               config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + 
"test." + ConfigConstants.METRICS_REPORTER_EXCLUDED_VARIABLES, "foo;bar");
+
+               final List<ReporterSetup> reporterSetups = 
ReporterSetup.fromConfiguration(config);
+
+               assertEquals(1, reporterSetups.size());
+
+               final ReporterSetup reporterSetup = reporterSetups.get(0);
+
+               assertThat(reporterSetup.getExcludedVariables(), 
hasItems(ScopeFormat.asVariable("foo"), ScopeFormat.asVariable("bar")));
 
 Review comment:
   nit: One could introduce variables for `foo` and `bar` so that we don't have 
two places where they are defined.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to