flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [2/2] flink git commit: [FLINK-4116][metrics] Move config keys to ConfigConstants
Date Mon, 11 Jul 2016 09:25:03 GMT
[FLINK-4116][metrics] Move config keys to ConfigConstants

This closes #2158


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/9178076d
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/9178076d
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/9178076d

Branch: refs/heads/master
Commit: 9178076db2ba352b25c541b0bf3ec4504ef0ba6d
Parents: 221ab8e
Author: zentol <chesnay@apache.org>
Authored: Fri Jul 1 15:42:24 2016 +0200
Committer: zentol <chesnay@apache.org>
Committed: Mon Jul 11 11:24:02 2016 +0200

----------------------------------------------------------------------
 docs/setup/config.md                            | 16 +++++++++
 .../flink/configuration/ConfigConstants.java    | 32 +++++++++++++++++
 .../apache/flink/metrics/MetricRegistry.java    | 36 +++++++-------------
 .../flink/metrics/reporter/JMXReporter.java     |  5 ++-
 .../flink/metrics/MetricRegistryTest.java       | 21 ++++++------
 .../groups/MetricGroupRegistrationTest.java     |  3 +-
 .../flink/metrics/reporter/JMXReporterTest.java | 11 +++---
 .../DropwizardFlinkHistogramWrapperTest.java    |  6 ++--
 .../metrics/statsd/StatsDReporterTest.java      |  7 ++--
 .../jobmanager/JobManagerMetricTest.java        |  9 +++--
 10 files changed, 91 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/9178076d/docs/setup/config.md
----------------------------------------------------------------------
diff --git a/docs/setup/config.md b/docs/setup/config.md
index dde3e11..46c6c9a 100644
--- a/docs/setup/config.md
+++ b/docs/setup/config.md
@@ -284,6 +284,22 @@ For example when running Flink on YARN on an environment with a restrictive
fire
 
 - `env.log.dir`: (Defaults to the `log` directory under Flink's home) Defines the directory
where the Flink logs are saved. It has to be an absolute path.
 
+## Metrics
+
+- `metrics.jmx.port`: (Default: 9010-9025) Defines the port used by JMX.
+
+- `metrics.scope.jm`: (Default: &lt;host&gt;.jobmanager) Defines the scope format
string that is applied to all metrics scoped to a JobManager.
+
+- `metrics.scope.jm.job`: (Default: &lt;host&gt;.jobmanager.&lt;job_name&gt;)
Defines the scope format string that is applied to all metrics scoped to a job on a JobManager.
+
+- `metrics.scope.tm`: (Default: &lt;host&gt;.taskmanager.&lt;tm_id&gt;) Defines
the scope format string that is applied to all metrics scoped to a TaskManager.
+
+- `metrics.scope.tm.job`: (Default: &lt;host&gt;.taskmanager.&lt;tm_id&gt;.&lt;job_name&gt;)
Defines the scope format string that is applied to all metrics scoped to a job on a TaskManager.
+
+- `metrics.scope.tm.task`: (Default: &lt;host&gt;.taskmanager.&lt;tm_id&gt;.&lt;job_name&gt;.&lt;task_name&gt;.&lt;subtask_index&gt;)
Defines the scope format string that is applied to all metrics scoped to a task.
+
+- `metrics.scope.tm.operator: (Default: &lt;host&gt;.taskmanager.&lt;tm_id&gt;.&lt;job_name&gt;.&lt;operator_name&gt;.&lt;subtask_index&gt;)
Defines the scope format string that is applied to all metrics scoped to an operator.
+
 ## Background
 
 ### Configuring the Network Buffers

http://git-wip-us.apache.org/repos/asf/flink/blob/9178076d/flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
b/flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
index 548acb7..2945fff 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java
@@ -625,6 +625,38 @@ public final class ConfigConstants {
 
 	public static final String ZOOKEEPER_MAX_RETRY_ATTEMPTS = "recovery.zookeeper.client.max-retry-attempts";
 
+	// ---------------------------- Metrics -----------------------------------
+
+	/** The port range from which JMX will pick one to listen for incoming connections. */
+	public static final String METRICS_JMX_PORT = "metrics.jmx.port";
+	
+	/** The class of the reporter to use. */
+	public static final String METRICS_REPORTER_CLASS = "metrics.reporter.class";
+	
+	/** A list of named parameters that are passed to the reporter. */
+	public static final String METRICS_REPORTER_ARGUMENTS = "metrics.reporter.arguments";
+	
+	/** The interval between reports. */
+	public static final String METRICS_REPORTER_INTERVAL = "metrics.reporter.interval";
+
+	/** The scope format string that is applied to all metrics scoped to a JobManager. */
+	public static final String METRICS_SCOPE_NAMING_JM = "metrics.scope.jm";
+
+	/** The scope format string that is applied to all metrics scoped to a TaskManager. */
+	public static final String METRICS_SCOPE_NAMING_TM = "metrics.scope.tm";
+
+	/** The scope format string that is applied to all metrics scoped to a job on a JobManager.
*/
+	public static final String METRICS_SCOPE_NAMING_JM_JOB = "metrics.scope.jm.job";
+
+	/** The scope format string that is applied to all metrics scoped to a job on a TaskManager.
*/
+	public static final String METRICS_SCOPE_NAMING_TM_JOB = "metrics.scope.tm.job";
+
+	/** The scope format string that is applied to all metrics scoped to a task. */
+	public static final String METRICS_SCOPE_NAMING_TASK = "metrics.scope.task";
+
+	/** The scope format string that is applied to all metrics scoped to an operator. */
+	public static final String METRICS_SCOPE_NAMING_OPERATOR = "metrics.scope.operator";
+
 	// ------------------------------------------------------------------------
 	//                            Default Values
 	// ------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/flink/blob/9178076d/flink-core/src/main/java/org/apache/flink/metrics/MetricRegistry.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/metrics/MetricRegistry.java b/flink-core/src/main/java/org/apache/flink/metrics/MetricRegistry.java
index dafa3bd..f4a0f48 100644
--- a/flink-core/src/main/java/org/apache/flink/metrics/MetricRegistry.java
+++ b/flink-core/src/main/java/org/apache/flink/metrics/MetricRegistry.java
@@ -19,6 +19,7 @@
 package org.apache.flink.metrics;
 
 import org.apache.flink.annotation.Internal;
+import org.apache.flink.configuration.ConfigConstants;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.metrics.groups.AbstractMetricGroup;
 import org.apache.flink.metrics.groups.scope.ScopeFormat;
@@ -46,19 +47,6 @@ public class MetricRegistry {
 	//  configuration keys
 	// ------------------------------------------------------------------------
 
-	public static final String KEY_METRICS_JMX_PORT = "metrics.jmx.port";
-
-	public static final String KEY_METRICS_REPORTER_CLASS = "metrics.reporter.class";
-	public static final String KEY_METRICS_REPORTER_ARGUMENTS = "metrics.reporter.arguments";
-	public static final String KEY_METRICS_REPORTER_INTERVAL = "metrics.reporter.interval";
-
-	public static final String KEY_METRICS_SCOPE_NAMING_JM = "metrics.scope.jm";
-	public static final String KEY_METRICS_SCOPE_NAMING_TM = "metrics.scope.tm";
-	public static final String KEY_METRICS_SCOPE_NAMING_JM_JOB = "metrics.scope.jm.job";
-	public static final String KEY_METRICS_SCOPE_NAMING_TM_JOB = "metrics.scope.tm.job";
-	public static final String KEY_METRICS_SCOPE_NAMING_TASK = "metrics.scope.task";
-	public static final String KEY_METRICS_SCOPE_NAMING_OPERATOR = "metrics.scope.operator";
-
 	// ------------------------------------------------------------------------
 	//  configuration keys
 	// ------------------------------------------------------------------------
@@ -87,7 +75,7 @@ public class MetricRegistry {
 
 		// second, instantiate any custom configured reporters
 		
-		final String className = config.getString(KEY_METRICS_REPORTER_CLASS, null);
+		final String className = config.getString(ConfigConstants.METRICS_REPORTER_CLASS, null);
 		if (className == null) {
 			// by default, create JMX metrics
 			LOG.info("No metrics reporter configured, exposing metrics via JMX");
@@ -98,7 +86,7 @@ public class MetricRegistry {
 			MetricReporter reporter;
 			ScheduledExecutorService executor = null;
 			try {
-				String configuredPeriod = config.getString(KEY_METRICS_REPORTER_INTERVAL, null);
+				String configuredPeriod = config.getString(ConfigConstants.METRICS_REPORTER_INTERVAL,
null);
 				TimeUnit timeunit = TimeUnit.SECONDS;
 				long period = 10;
 				
@@ -143,9 +131,9 @@ public class MetricRegistry {
 		JMXReporter reporter = null;
 		try {
 			Configuration reporterConfig = new Configuration();
-			String portRange = config.getString(KEY_METRICS_JMX_PORT, null);
+			String portRange = config.getString(ConfigConstants.METRICS_JMX_PORT, null);
 			if (portRange != null) {
-				reporterConfig.setString(KEY_METRICS_JMX_PORT, portRange);
+				reporterConfig.setString(ConfigConstants.METRICS_JMX_PORT, portRange);
 			}
 			reporter = new JMXReporter();
 			reporter.open(reporterConfig);
@@ -235,7 +223,7 @@ public class MetricRegistry {
 		reporterConfig.setLong("period", period);
 		reporterConfig.setString("timeunit", timeunit.name());
 
-		String[] arguments = config.getString(KEY_METRICS_REPORTER_ARGUMENTS, "").split(" ");
+		String[] arguments = config.getString(ConfigConstants.METRICS_REPORTER_ARGUMENTS, "").split("
");
 		if (arguments.length > 1) {
 			for (int x = 0; x < arguments.length; x += 2) {
 				reporterConfig.setString(arguments[x].replace("--", ""), arguments[x + 1]);
@@ -246,17 +234,17 @@ public class MetricRegistry {
 
 	static ScopeFormats createScopeConfig(Configuration config) {
 		String jmFormat = config.getString(
-				KEY_METRICS_SCOPE_NAMING_JM, ScopeFormat.DEFAULT_SCOPE_JOBMANAGER_GROUP);
+				ConfigConstants.METRICS_SCOPE_NAMING_JM, ScopeFormat.DEFAULT_SCOPE_JOBMANAGER_GROUP);
 		String jmJobFormat = config.getString(
-			KEY_METRICS_SCOPE_NAMING_JM_JOB, ScopeFormat.DEFAULT_SCOPE_JOBMANAGER_JOB_GROUP);
+			ConfigConstants.METRICS_SCOPE_NAMING_JM_JOB, ScopeFormat.DEFAULT_SCOPE_JOBMANAGER_JOB_GROUP);
 		String tmFormat = config.getString(
-				KEY_METRICS_SCOPE_NAMING_TM, ScopeFormat.DEFAULT_SCOPE_TASKMANAGER_GROUP);
+				ConfigConstants.METRICS_SCOPE_NAMING_TM, ScopeFormat.DEFAULT_SCOPE_TASKMANAGER_GROUP);
 		String tmJobFormat = config.getString(
-				KEY_METRICS_SCOPE_NAMING_TM_JOB, ScopeFormat.DEFAULT_SCOPE_TASKMANAGER_JOB_GROUP);
+				ConfigConstants.METRICS_SCOPE_NAMING_TM_JOB, ScopeFormat.DEFAULT_SCOPE_TASKMANAGER_JOB_GROUP);
 		String taskFormat = config.getString(
-				KEY_METRICS_SCOPE_NAMING_TASK, ScopeFormat.DEFAULT_SCOPE_TASK_GROUP);
+				ConfigConstants.METRICS_SCOPE_NAMING_TASK, ScopeFormat.DEFAULT_SCOPE_TASK_GROUP);
 		String operatorFormat = config.getString(
-				KEY_METRICS_SCOPE_NAMING_OPERATOR, ScopeFormat.DEFAULT_SCOPE_OPERATOR_GROUP);
+				ConfigConstants.METRICS_SCOPE_NAMING_OPERATOR, ScopeFormat.DEFAULT_SCOPE_OPERATOR_GROUP);
 		
 		return new ScopeFormats(jmFormat, jmJobFormat, tmFormat, tmJobFormat, taskFormat, operatorFormat);
 	}

http://git-wip-us.apache.org/repos/asf/flink/blob/9178076d/flink-core/src/main/java/org/apache/flink/metrics/reporter/JMXReporter.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/metrics/reporter/JMXReporter.java b/flink-core/src/main/java/org/apache/flink/metrics/reporter/JMXReporter.java
index bdaf68a..2effb5b 100644
--- a/flink-core/src/main/java/org/apache/flink/metrics/reporter/JMXReporter.java
+++ b/flink-core/src/main/java/org/apache/flink/metrics/reporter/JMXReporter.java
@@ -19,6 +19,7 @@
 package org.apache.flink.metrics.reporter;
 
 import org.apache.flink.annotation.Internal;
+import org.apache.flink.configuration.ConfigConstants;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.metrics.Counter;
 import org.apache.flink.metrics.Gauge;
@@ -49,8 +50,6 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
-import static org.apache.flink.metrics.MetricRegistry.KEY_METRICS_JMX_PORT;
-
 /**
  * {@link MetricReporter} that exports {@link Metric Metrics} via JMX.
  *
@@ -94,7 +93,7 @@ public class JMXReporter implements MetricReporter {
 	}
 
 	private static JMXServer startJmxServer(Configuration config) {
-		Iterator<Integer> ports = NetUtils.getPortRangeFromString(config.getString(KEY_METRICS_JMX_PORT,
"9010-9025"));
+		Iterator<Integer> ports = NetUtils.getPortRangeFromString(config.getString(ConfigConstants.METRICS_JMX_PORT,
"9010-9025"));
 
 		JMXServer server = new JMXServer();
 		while (ports.hasNext()) {

http://git-wip-us.apache.org/repos/asf/flink/blob/9178076d/flink-core/src/test/java/org/apache/flink/metrics/MetricRegistryTest.java
----------------------------------------------------------------------
diff --git a/flink-core/src/test/java/org/apache/flink/metrics/MetricRegistryTest.java b/flink-core/src/test/java/org/apache/flink/metrics/MetricRegistryTest.java
index 42464ed..4e0f4d0 100644
--- a/flink-core/src/test/java/org/apache/flink/metrics/MetricRegistryTest.java
+++ b/flink-core/src/test/java/org/apache/flink/metrics/MetricRegistryTest.java
@@ -18,6 +18,7 @@
 
 package org.apache.flink.metrics;
 
+import org.apache.flink.configuration.ConfigConstants;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.metrics.groups.AbstractMetricGroup;
 import org.apache.flink.metrics.groups.TaskManagerMetricGroup;
@@ -40,7 +41,7 @@ public class MetricRegistryTest extends TestLogger {
 	public void testReporterInstantiation() {
 		Configuration config = new Configuration();
 
-		config.setString(MetricRegistry.KEY_METRICS_REPORTER_CLASS, TestReporter1.class.getName());
+		config.setString(ConfigConstants.METRICS_REPORTER_CLASS, TestReporter1.class.getName());
 
 		new MetricRegistry(config);
 
@@ -63,8 +64,8 @@ public class MetricRegistryTest extends TestLogger {
 	public void testReporterArgumentForwarding() {
 		Configuration config = new Configuration();
 
-		config.setString(MetricRegistry.KEY_METRICS_REPORTER_CLASS, TestReporter2.class.getName());
-		config.setString(MetricRegistry.KEY_METRICS_REPORTER_ARGUMENTS, "--arg1 hello --arg2 world");
+		config.setString(ConfigConstants.METRICS_REPORTER_CLASS, TestReporter2.class.getName());
+		config.setString(ConfigConstants.METRICS_REPORTER_ARGUMENTS, "--arg1 hello --arg2 world");
 
 		new MetricRegistry(config);
 	}
@@ -86,8 +87,8 @@ public class MetricRegistryTest extends TestLogger {
 	public void testReporterScheduling() throws InterruptedException {
 		Configuration config = new Configuration();
 
-		config.setString(MetricRegistry.KEY_METRICS_REPORTER_CLASS, TestReporter3.class.getName());
-		config.setString(MetricRegistry.KEY_METRICS_REPORTER_INTERVAL, "50 MILLISECONDS");
+		config.setString(ConfigConstants.METRICS_REPORTER_CLASS, TestReporter3.class.getName());
+		config.setString(ConfigConstants.METRICS_REPORTER_INTERVAL, "50 MILLISECONDS");
 
 		new MetricRegistry(config);
 
@@ -125,7 +126,7 @@ public class MetricRegistryTest extends TestLogger {
 	@Test
 	public void testListener() {
 		Configuration config = new Configuration();
-		config.setString(MetricRegistry.KEY_METRICS_REPORTER_CLASS, TestReporter6.class.getName());
+		config.setString(ConfigConstants.METRICS_REPORTER_CLASS, TestReporter6.class.getName());
 
 		MetricRegistry registry = new MetricRegistry(config);
 
@@ -163,10 +164,10 @@ public class MetricRegistryTest extends TestLogger {
 	public void testScopeConfig() {
 		Configuration config = new Configuration();
 
-		config.setString(MetricRegistry.KEY_METRICS_SCOPE_NAMING_TM, "A");
-		config.setString(MetricRegistry.KEY_METRICS_SCOPE_NAMING_TM_JOB, "B");
-		config.setString(MetricRegistry.KEY_METRICS_SCOPE_NAMING_TASK, "C");
-		config.setString(MetricRegistry.KEY_METRICS_SCOPE_NAMING_OPERATOR, "D");
+		config.setString(ConfigConstants.METRICS_SCOPE_NAMING_TM, "A");
+		config.setString(ConfigConstants.METRICS_SCOPE_NAMING_TM_JOB, "B");
+		config.setString(ConfigConstants.METRICS_SCOPE_NAMING_TASK, "C");
+		config.setString(ConfigConstants.METRICS_SCOPE_NAMING_OPERATOR, "D");
 
 		ScopeFormats scopeConfig = MetricRegistry.createScopeConfig(config);
 

http://git-wip-us.apache.org/repos/asf/flink/blob/9178076d/flink-core/src/test/java/org/apache/flink/metrics/groups/MetricGroupRegistrationTest.java
----------------------------------------------------------------------
diff --git a/flink-core/src/test/java/org/apache/flink/metrics/groups/MetricGroupRegistrationTest.java
b/flink-core/src/test/java/org/apache/flink/metrics/groups/MetricGroupRegistrationTest.java
index c7a112a..70827b8 100644
--- a/flink-core/src/test/java/org/apache/flink/metrics/groups/MetricGroupRegistrationTest.java
+++ b/flink-core/src/test/java/org/apache/flink/metrics/groups/MetricGroupRegistrationTest.java
@@ -17,6 +17,7 @@
  */
 package org.apache.flink.metrics.groups;
 
+import org.apache.flink.configuration.ConfigConstants;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.metrics.Counter;
 import org.apache.flink.metrics.Gauge;
@@ -39,7 +40,7 @@ public class MetricGroupRegistrationTest {
 	@Test
 	public void testMetricInstantiation() {
 		Configuration config = new Configuration();
-		config.setString(MetricRegistry.KEY_METRICS_REPORTER_CLASS, TestReporter1.class.getName());
+		config.setString(ConfigConstants.METRICS_REPORTER_CLASS, TestReporter1.class.getName());
 
 		MetricRegistry registry = new MetricRegistry(config);
 

http://git-wip-us.apache.org/repos/asf/flink/blob/9178076d/flink-core/src/test/java/org/apache/flink/metrics/reporter/JMXReporterTest.java
----------------------------------------------------------------------
diff --git a/flink-core/src/test/java/org/apache/flink/metrics/reporter/JMXReporterTest.java
b/flink-core/src/test/java/org/apache/flink/metrics/reporter/JMXReporterTest.java
index d3378cc..99ee271 100644
--- a/flink-core/src/test/java/org/apache/flink/metrics/reporter/JMXReporterTest.java
+++ b/flink-core/src/test/java/org/apache/flink/metrics/reporter/JMXReporterTest.java
@@ -18,6 +18,7 @@
 
 package org.apache.flink.metrics.reporter;
 
+import org.apache.flink.configuration.ConfigConstants;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.metrics.Gauge;
 import org.apache.flink.metrics.Histogram;
@@ -38,8 +39,6 @@ import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXServiceURL;
 import java.lang.management.ManagementFactory;
 
-import static org.apache.flink.metrics.MetricRegistry.KEY_METRICS_JMX_PORT;
-import static org.apache.flink.metrics.MetricRegistry.KEY_METRICS_REPORTER_CLASS;
 import static org.junit.Assert.assertEquals;
 
 public class JMXReporterTest extends TestLogger {
@@ -80,7 +79,7 @@ public class JMXReporterTest extends TestLogger {
 	@Test
 	public void testPortConflictHandling() throws Exception {
 		Configuration cfg = new Configuration();
-		cfg.setString(KEY_METRICS_REPORTER_CLASS, TestReporter.class.getName());
+		cfg.setString(ConfigConstants.METRICS_REPORTER_CLASS, TestReporter.class.getName());
 		MetricRegistry reg = new MetricRegistry(cfg);
 
 		TaskManagerMetricGroup mg = new TaskManagerMetricGroup(reg, "host", "tm");
@@ -89,7 +88,7 @@ public class JMXReporterTest extends TestLogger {
 		JMXReporter rep2 = new JMXReporter();
 
 		Configuration cfg1 = new Configuration();
-		cfg1.setString(KEY_METRICS_JMX_PORT, "9020-9035");
+		cfg1.setString(ConfigConstants.METRICS_JMX_PORT, "9020-9035");
 
 		rep1.open(cfg1);
 		rep2.open(cfg1);
@@ -129,7 +128,7 @@ public class JMXReporterTest extends TestLogger {
 	@Test
 	public void testJMXAvailability() throws Exception {
 		Configuration cfg = new Configuration();
-		cfg.setString(KEY_METRICS_REPORTER_CLASS, TestReporter.class.getName());
+		cfg.setString(ConfigConstants.METRICS_REPORTER_CLASS, TestReporter.class.getName());
 		MetricRegistry reg = new MetricRegistry(cfg);
 
 		TaskManagerMetricGroup mg = new TaskManagerMetricGroup(reg, "host", "tm");
@@ -138,7 +137,7 @@ public class JMXReporterTest extends TestLogger {
 		JMXReporter rep2 = new JMXReporter();
 
 		Configuration cfg1 = new Configuration();
-		cfg1.setString(KEY_METRICS_JMX_PORT, "9040-9055");
+		cfg1.setString(ConfigConstants.METRICS_JMX_PORT, "9040-9055");
 		rep1.open(cfg1);
 		rep2.open(cfg1);
 

http://git-wip-us.apache.org/repos/asf/flink/blob/9178076d/flink-metrics/flink-metrics-dropwizard/src/test/java/org/apache/flink/dropwizard/metrics/DropwizardFlinkHistogramWrapperTest.java
----------------------------------------------------------------------
diff --git a/flink-metrics/flink-metrics-dropwizard/src/test/java/org/apache/flink/dropwizard/metrics/DropwizardFlinkHistogramWrapperTest.java
b/flink-metrics/flink-metrics-dropwizard/src/test/java/org/apache/flink/dropwizard/metrics/DropwizardFlinkHistogramWrapperTest.java
index 2479c26..8ae0186 100644
--- a/flink-metrics/flink-metrics-dropwizard/src/test/java/org/apache/flink/dropwizard/metrics/DropwizardFlinkHistogramWrapperTest.java
+++ b/flink-metrics/flink-metrics-dropwizard/src/test/java/org/apache/flink/dropwizard/metrics/DropwizardFlinkHistogramWrapperTest.java
@@ -26,6 +26,7 @@ import com.codahale.metrics.ScheduledReporter;
 import com.codahale.metrics.SlidingWindowReservoir;
 import com.codahale.metrics.Snapshot;
 import com.codahale.metrics.Timer;
+import org.apache.flink.configuration.ConfigConstants;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.dropwizard.ScheduledDropwizardReporter;
 import org.apache.flink.metrics.MetricRegistry;
@@ -46,7 +47,6 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
-import static org.apache.flink.metrics.MetricRegistry.KEY_METRICS_REPORTER_INTERVAL;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
@@ -95,8 +95,8 @@ public class DropwizardFlinkHistogramWrapperTest extends TestLogger {
 		int size = 10;
 		String histogramMetricName = "histogram";
 		Configuration config = new Configuration();
-		config.setString(MetricRegistry.KEY_METRICS_REPORTER_CLASS, TestingReporter.class.getName());
-		config.setString(KEY_METRICS_REPORTER_INTERVAL, reportingInterval + " MILLISECONDS");
+		config.setString(ConfigConstants.METRICS_REPORTER_CLASS, TestingReporter.class.getName());
+		config.setString(ConfigConstants.METRICS_REPORTER_INTERVAL, reportingInterval + " MILLISECONDS");
 
 		MetricRegistry registry = null;
 

http://git-wip-us.apache.org/repos/asf/flink/blob/9178076d/flink-metrics/flink-metrics-statsd/src/test/java/org/apache/flink/metrics/statsd/StatsDReporterTest.java
----------------------------------------------------------------------
diff --git a/flink-metrics/flink-metrics-statsd/src/test/java/org/apache/flink/metrics/statsd/StatsDReporterTest.java
b/flink-metrics/flink-metrics-statsd/src/test/java/org/apache/flink/metrics/statsd/StatsDReporterTest.java
index a23a5b5..4d29e90 100644
--- a/flink-metrics/flink-metrics-statsd/src/test/java/org/apache/flink/metrics/statsd/StatsDReporterTest.java
+++ b/flink-metrics/flink-metrics-statsd/src/test/java/org/apache/flink/metrics/statsd/StatsDReporterTest.java
@@ -18,6 +18,7 @@
 
 package org.apache.flink.metrics.statsd;
 
+import org.apache.flink.configuration.ConfigConstants;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.metrics.Histogram;
 import org.apache.flink.metrics.HistogramStatistics;
@@ -77,9 +78,9 @@ public class StatsDReporterTest extends TestLogger {
 			int port = receiver.getPort();
 
 			Configuration config = new Configuration();
-			config.setString(MetricRegistry.KEY_METRICS_REPORTER_CLASS, StatsDReporter.class.getName());
-			config.setString(MetricRegistry.KEY_METRICS_REPORTER_INTERVAL, "1 SECONDS");
-			config.setString(MetricRegistry.KEY_METRICS_REPORTER_ARGUMENTS, "--host localhost --port
" + port);
+			config.setString(ConfigConstants.METRICS_REPORTER_CLASS, StatsDReporter.class.getName());
+			config.setString(ConfigConstants.METRICS_REPORTER_INTERVAL, "1 SECONDS");
+			config.setString(ConfigConstants.METRICS_REPORTER_ARGUMENTS, "--host localhost --port
" + port);
 
 			registry = new MetricRegistry(config);
 

http://git-wip-us.apache.org/repos/asf/flink/blob/9178076d/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerMetricTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerMetricTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerMetricTest.java
index 53548fb..2e338bc 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerMetricTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerMetricTest.java
@@ -17,6 +17,7 @@
  */
 package org.apache.flink.runtime.jobmanager;
 
+import org.apache.flink.configuration.ConfigConstants;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.runtime.jobgraph.JobGraph;
 import org.apache.flink.runtime.jobgraph.JobVertex;
@@ -37,8 +38,6 @@ import java.lang.management.ManagementFactory;
 import java.util.Collections;
 import java.util.concurrent.TimeUnit;
 
-import static org.apache.flink.metrics.MetricRegistry.KEY_METRICS_JMX_PORT;
-import static org.apache.flink.metrics.MetricRegistry.KEY_METRICS_SCOPE_NAMING_JM_JOB;
 import static org.junit.Assert.assertEquals;
 
 public class JobManagerMetricTest {
@@ -51,9 +50,9 @@ public class JobManagerMetricTest {
 	public void testJobManagerMetricAccess() throws Exception {
 		Deadline deadline = new FiniteDuration(2, TimeUnit.MINUTES).fromNow();
 		Configuration flinkConfiguration = new Configuration();
-
-		flinkConfiguration.setString(KEY_METRICS_SCOPE_NAMING_JM_JOB, "jobmanager.<job_name>");
-		flinkConfiguration.setString(KEY_METRICS_JMX_PORT, "9060-9075");
+		
+		flinkConfiguration.setString(ConfigConstants.METRICS_SCOPE_NAMING_JM_JOB, "jobmanager.<job_name>");
+		flinkConfiguration.setString(ConfigConstants.METRICS_JMX_PORT, "9060-9075");
 
 		TestingCluster flink = new TestingCluster(flinkConfiguration);
 


Mime
View raw message