flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [3/7] flink git commit: [FLINK-7724] [metrics] Add extra metrics to MetricStoreTest.setupStore
Date Thu, 28 Sep 2017 11:01:01 GMT
[FLINK-7724] [metrics] Add extra metrics to MetricStoreTest.setupStore

This closes #4739.


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

Branch: refs/heads/master
Commit: f85bbf309ab95bbbea38d03094b74682f5dbc63a
Parents: 278989c
Author: Bowen Li <bowenli86@gmail.com>
Authored: Wed Sep 27 15:30:02 2017 -0700
Committer: zentol <chesnay@apache.org>
Committed: Thu Sep 28 11:28:32 2017 +0200

----------------------------------------------------------------------
 .../legacy/metrics/AbstractMetricsHandlerTest.java   | 15 ++++++++-------
 .../legacy/metrics/JobMetricsHandlerTest.java        |  1 +
 .../legacy/metrics/JobVertexMetricsHandlerTest.java  |  6 +++---
 .../rest/handler/legacy/metrics/MetricStoreTest.java | 14 ++++++++++----
 4 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/f85bbf30/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/AbstractMetricsHandlerTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/AbstractMetricsHandlerTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/AbstractMetricsHandlerTest.java
index 7cbbdc1..8c38e79 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/AbstractMetricsHandlerTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/AbstractMetricsHandlerTest.java
@@ -61,30 +61,31 @@ public class AbstractMetricsHandlerTest extends TestLogger {
 		String availableList = handler.handleJsonRequest(pathParams, queryParams, null).get();
 
 		assertEquals("[" +
-				"{\"id\":\"8.opname.abc.metric5\"}," +
-				"{\"id\":\"8.abc.metric4\"}" +
+				"{\"id\":\"8.opname.abc.metric6\"}," +
+				"{\"id\":\"8.opname.abc.metric7\"}," +
+				"{\"id\":\"8.abc.metric5\"}" +
 				"]",
 			availableList);
 
 		// get value for a single metric
-		queryParams.put("get", "8.opname.abc.metric5");
+		queryParams.put("get", "8.opname.abc.metric6");
 
 		String metricValue = handler.handleJsonRequest(pathParams, queryParams, null).get();
 
 		assertEquals("[" +
-				"{\"id\":\"8.opname.abc.metric5\",\"value\":\"4\"}" +
+				"{\"id\":\"8.opname.abc.metric6\",\"value\":\"5\"}" +
 				"]"
 			, metricValue
 		);
 
 		// get values for multiple metrics
-		queryParams.put("get", "8.opname.abc.metric5,8.abc.metric4");
+		queryParams.put("get", "8.opname.abc.metric6,8.abc.metric5");
 
 		String metricValues = handler.handleJsonRequest(pathParams, queryParams, null).get();
 
 		assertEquals("[" +
-				"{\"id\":\"8.opname.abc.metric5\",\"value\":\"4\"}," +
-				"{\"id\":\"8.abc.metric4\",\"value\":\"3\"}" +
+				"{\"id\":\"8.opname.abc.metric6\",\"value\":\"5\"}," +
+				"{\"id\":\"8.abc.metric5\",\"value\":\"4\"}" +
 				"]",
 			metricValues
 		);

http://git-wip-us.apache.org/repos/asf/flink/blob/f85bbf30/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandlerTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandlerTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandlerTest.java
index 4b28e65..97ccd07 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandlerTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobMetricsHandlerTest.java
@@ -64,6 +64,7 @@ public class JobMetricsHandlerTest extends TestLogger {
 		Map<String, String> metrics = handler.getMapFor(pathParams, store);
 
 		assertEquals("2", metrics.get("abc.metric3"));
+		assertEquals("3", metrics.get("abc.metric4"));
 	}
 
 	@Test

http://git-wip-us.apache.org/repos/asf/flink/blob/f85bbf30/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobVertexMetricsHandlerTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobVertexMetricsHandlerTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobVertexMetricsHandlerTest.java
index c1304c4..1dee996 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobVertexMetricsHandlerTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/JobVertexMetricsHandlerTest.java
@@ -65,9 +65,9 @@ public class JobVertexMetricsHandlerTest extends TestLogger {
 
 		Map<String, String> metrics = handler.getMapFor(pathParams, store);
 
-		assertEquals("3", metrics.get("8.abc.metric4"));
-
-		assertEquals("4", metrics.get("8.opname.abc.metric5"));
+		assertEquals("4", metrics.get("8.abc.metric5"));
+		assertEquals("5", metrics.get("8.opname.abc.metric6"));
+		assertEquals("6", metrics.get("8.opname.abc.metric7"));
 	}
 
 	@Test

http://git-wip-us.apache.org/repos/asf/flink/blob/f85bbf30/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStoreTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStoreTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStoreTest.java
index 2e83e08..31225ad 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStoreTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStoreTest.java
@@ -39,8 +39,10 @@ public class MetricStoreTest extends TestLogger {
 		assertEquals("0", store.getJobManagerMetricStore().getMetric("abc.metric1", "-1"));
 		assertEquals("1", store.getTaskManagerMetricStore("tmid").getMetric("abc.metric2", "-1"));
 		assertEquals("2", store.getJobMetricStore("jobid").getMetric("abc.metric3", "-1"));
-		assertEquals("3", store.getTaskMetricStore("jobid", "taskid").getMetric("8.abc.metric4",
"-1"));
-		assertEquals("4", store.getTaskMetricStore("jobid", "taskid").getMetric("8.opname.abc.metric5",
"-1"));
+		assertEquals("3", store.getJobMetricStore("jobid").getMetric("abc.metric4", "-1"));
+		assertEquals("4", store.getTaskMetricStore("jobid", "taskid").getMetric("8.abc.metric5",
"-1"));
+		assertEquals("5", store.getTaskMetricStore("jobid", "taskid").getMetric("8.opname.abc.metric6",
"-1"));
+		assertEquals("6", store.getTaskMetricStore("jobid", "taskid").getMetric("8.opname.abc.metric7",
"-1"));
 	}
 
 	@Test
@@ -70,18 +72,22 @@ public class MetricStoreTest extends TestLogger {
 
 		QueryScopeInfo.JobQueryScopeInfo job = new QueryScopeInfo.JobQueryScopeInfo("jobid", "abc");
 		MetricDump.CounterDump cd3 = new MetricDump.CounterDump(job, "metric3", 2);
+		MetricDump.CounterDump cd4 = new MetricDump.CounterDump(job, "metric4", 3);
 
 		QueryScopeInfo.TaskQueryScopeInfo task = new QueryScopeInfo.TaskQueryScopeInfo("jobid",
"taskid", 8, "abc");
-		MetricDump.CounterDump cd4 = new MetricDump.CounterDump(task, "metric4", 3);
+		MetricDump.CounterDump cd5 = new MetricDump.CounterDump(task, "metric5", 4);
 
 		QueryScopeInfo.OperatorQueryScopeInfo operator = new QueryScopeInfo.OperatorQueryScopeInfo("jobid",
"taskid", 8, "opname", "abc");
-		MetricDump.CounterDump cd5 = new MetricDump.CounterDump(operator, "metric5", 4);
+		MetricDump.CounterDump cd6 = new MetricDump.CounterDump(operator, "metric6", 5);
+		MetricDump.CounterDump cd7 = new MetricDump.CounterDump(operator, "metric7", 6);
 
 		store.add(cd1);
 		store.add(cd2);
 		store.add(cd3);
 		store.add(cd4);
 		store.add(cd5);
+		store.add(cd6);
+		store.add(cd7);
 
 		return store;
 	}


Mime
View raw message