You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by qu...@apache.org on 2016/10/05 22:50:33 UTC

[2/2] incubator-edgent git commit: [EDGENT-200] Console: Add tuple counts for the 'Static flow' layer

[EDGENT-200] Console: Add tuple counts for the 'Static flow' layer


Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/829f2526
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/829f2526
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/829f2526

Branch: refs/heads/master
Commit: 829f2526549b9979d8c5faee11b66837652cb670
Parents: dae7e4c
Author: Queenie Ma <qu...@gmail.com>
Authored: Wed Oct 5 14:22:57 2016 -0700
Committer: Queenie Ma <qu...@gmail.com>
Committed: Wed Oct 5 14:22:57 2016 -0700

----------------------------------------------------------------------
 console/servlets/webapp_content/js/index.js | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/829f2526/console/servlets/webapp_content/js/index.js
----------------------------------------------------------------------
diff --git a/console/servlets/webapp_content/js/index.js b/console/servlets/webapp_content/js/index.js
index bfa8248..dd536f8 100644
--- a/console/servlets/webapp_content/js/index.js
+++ b/console/servlets/webapp_content/js/index.js
@@ -706,7 +706,7 @@ var makeRows = function() {
 			var sourceLinks = trg.sourceIdx.sourceLinks;
 			for (var i = 0; i < sourceLinks.length; i++) {
 				if (trg.sourceId == sourceLinks[i].sourceId && trg.targetId == sourceLinks[i].targetId) {
-					sourceStreamTupleCountsMap.set(source, formatNumber(sourceLinks[i].value));
+					sourceStreamTupleCountsMap.set(source, parseInt(sourceLinks[i].value));
 					if (sourceLinks[i].hasOwnProperty("alias")) {
 						sourceStreamAliasesMap.set(source, sourceLinks[i].alias);
 					} else {
@@ -730,7 +730,7 @@ var makeRows = function() {
 			var targetLinks = src.targetIdx.targetLinks;
 			for (var i = 0; i < targetLinks.length; i++) {
 				if (src.sourceId == targetLinks[i].sourceId && src.targetId == targetLinks[i].targetId) {
-					targetStreamTupleCountsMap.set(target, formatNumber(targetLinks[i].value));
+					targetStreamTupleCountsMap.set(target, parseInt(targetLinks[i].value));
 					if (targetLinks[i].hasOwnProperty("alias")) {
 						targetStreamAliasesMap.set(target, targetLinks[i].alias);
 					} else {
@@ -1056,6 +1056,9 @@ var renderGraph = function(jobId, counterMetrics, bIsNewJob) {
 		
 		var i = 0;
 		graph.edges.forEach(function(edge) {
+			// Store the real flow value so that we can access it in the static layer
+			edge.flowValue = edge.value;
+
 			var value = "";
 			if (layer === "static" || !edge.value) {
 				value = generatedFlowValues[i];
@@ -1303,7 +1306,12 @@ var renderGraph = function(jobId, counterMetrics, bIsNewJob) {
 			var sourceLinks = trg.sourceIdx.sourceLinks;
 			for (var i = 0; i < sourceLinks.length; i++) {
 				if (trg.sourceId == sourceLinks[i].sourceId && trg.targetId == sourceLinks[i].targetId) {
-					sourceStreamTupleCountsMap.set(source, formatNumber(sourceLinks[i].value));
+					if (layer == "static") {
+						sourceStreamTupleCountsMap.set(source, parseInt(sourceLinks[i].flowValue));
+					} else {
+						sourceStreamTupleCountsMap.set(source, parseInt(sourceLinks[i].value));
+					}
+
 					if (sourceLinks[i].hasOwnProperty("alias")) {
 						sourceStreamAliasesMap.set(source, sourceLinks[i].alias);
 					} else {
@@ -1327,7 +1335,12 @@ var renderGraph = function(jobId, counterMetrics, bIsNewJob) {
 			var targetLinks = src.targetIdx.targetLinks;
 			for (var i = 0; i < targetLinks.length; i++) {
 				if (src.sourceId == targetLinks[i].sourceId && src.targetId == targetLinks[i].targetId) {
-					targetStreamTupleCountsMap.set(target, formatNumber(targetLinks[i].value));
+					if (layer == "static") {
+						targetStreamTupleCountsMap.set(target, parseInt(targetLinks[i].flowValue));
+					} else {
+						targetStreamTupleCountsMap.set(target, parseInt(targetLinks[i].value));
+					}
+
 					if (targetLinks[i].hasOwnProperty("alias")) {
 						targetStreamAliasesMap.set(target, targetLinks[i].alias);
 					} else {