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 #2285: [FLINK-4246] Allow Specifying Multiple Metrics Rep...
Date Fri, 22 Jul 2016 15:31:26 GMT
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2285#discussion_r71898033
  
    --- Diff: flink-core/src/main/java/org/apache/flink/metrics/MetricRegistry.java ---
    @@ -75,77 +78,92 @@ public MetricRegistry(Configuration config) {
     		this.delimiter = delim;
     
     		// second, instantiate any custom configured reporters
    -		
    -		final String className = config.getString(ConfigConstants.METRICS_REPORTER_CLASS, null);
    -		if (className == null) {
    +		this.reporters = new ArrayList<>();
    +
    +		final String definedReporters = config.getString(ConfigConstants.METRICS_REPORTERS_LIST,
null);
    +
    +		if (definedReporters == null) {
    +			// no reporters defined
     			// by default, don't report anything
     			LOG.info("No metrics reporter configured, no metrics will be exposed/reported.");
    -			this.reporter = null;
     			this.executor = null;
    -		}
    -		else {
    -			MetricReporter reporter;
    -			ScheduledExecutorService executor = null;
    -			try {
    -				String configuredPeriod = config.getString(ConfigConstants.METRICS_REPORTER_INTERVAL,
null);
    -				TimeUnit timeunit = TimeUnit.SECONDS;
    -				long period = 10;
    -				
    -				if (configuredPeriod != null) {
    -					try {
    -						String[] interval = configuredPeriod.split(" ");
    -						period = Long.parseLong(interval[0]);
    -						timeunit = TimeUnit.valueOf(interval[1]);
    +		} else {
    +			// we have some reporters so
    +			String[] namedReporters = definedReporters.split(",");
    +			for (String namedReporter : namedReporters) {
    --- End diff --
    
    yes. but this will go completely unnoticed to a user since nothing is being logged.


---
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