flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zentol <...@git.apache.org>
Subject [GitHub] flink pull request #2517: [FLINK-4564] [metrics] Delimiter should be configu...
Date Mon, 26 Sep 2016 14:06:06 GMT
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2517#discussion_r80477622
  
    --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/metrics/MetricRegistryTest.java
---
    @@ -280,4 +282,65 @@ public void testConfigurableDelimiter() {
     
     		registry.shutdown();
     	}
    +
    +	@Test
    +	public void testConfigurableDelimiterForReporters() {
    +		Configuration config = new Configuration();
    +		config.setString(ConfigConstants.METRICS_REPORTERS_LIST, "test1,test2,test3");
    +		config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test1." + ConfigConstants.METRICS_REPORTER_SCOPE_DELIMITER,
"_");
    +		config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test1." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX,
TestReporter.class.getName());
    +		config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test2." + ConfigConstants.METRICS_REPORTER_SCOPE_DELIMITER,
"-");
    +		config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test2." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX,
TestReporter.class.getName());
    +		config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test3." + ConfigConstants.METRICS_REPORTER_SCOPE_DELIMITER,
"AA");
    +		config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test3." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX,
TestReporter.class.getName());
    +
    +		MetricRegistry registry = new MetricRegistry(config);
    +
    +		assertEquals('.', registry.getDelimiter());
    --- End diff --
    
    introducing a static final char field for the global delimiter would improve readability.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message