[ 
https://issues.apache.org/jira/browse/FLINK-8080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16282446#comment-16282446
 ] 

ASF GitHub Bot commented on FLINK-8080:
---------------------------------------

Github user greghogan commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5099#discussion_r155625966
  
    --- Diff: 
flink-runtime/src/test/java/org/apache/flink/runtime/metrics/MetricRegistryImplTest.java
 ---
    @@ -76,8 +76,27 @@ public void testIsShutdown() {
        public void testReporterInstantiation() {
                Configuration config = new Configuration();
     
    +           config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + 
"test." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX, 
TestReporter1.class.getName());
    +
    +           MetricRegistryImpl metricRegistry = new 
MetricRegistryImpl(MetricRegistryConfiguration.fromConfiguration(config));
    +
    +           assertTrue(metricRegistry.getReporters().size() == 1);
    +
    +           Assert.assertTrue(TestReporter1.wasOpened);
    +
    +           metricRegistry.shutdown();
    +   }
    +
    +   /**
    +    * Verifies that the reporter name list is correctly used to determine 
which reporters should be instantiated.
    +    */
    +   @Test
    +   public void testReporterInclusion() {
    +           Configuration config = new Configuration();
    +
                config.setString(MetricOptions.REPORTERS_LIST, "test");
                config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + 
"test." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX, 
TestReporter1.class.getName());
    +           config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + 
"test1." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX, 
TestReporter1.class.getName());
    --- End diff --
    
    Use a `TestReporter2` and verify not opened? Do we need both 
`testReporterInstantiation` and `testReporterInclusion`?


> Remove need for "metrics.reporters"
> -----------------------------------
>
>                 Key: FLINK-8080
>                 URL: https://issues.apache.org/jira/browse/FLINK-8080
>             Project: Flink
>          Issue Type: Improvement
>          Components: Configuration, Metrics
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>            Priority: Trivial
>             Fix For: 1.5.0
>
>
> Currently, in order to use a reporter one must configure something like this:
> {code}
> metrics.reporters: jmx
> metrics.reporter.jmx.class: ...
> {code}
> It would be neat if users did not have to set {{metrics.reporters}}. We can 
> accomplish this by a scanning the configuration for configuration keys 
> starting with {{metrics.reporter.}} and using the next word as a reporter 
> name.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to