qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eal...@apache.org
Subject qpid-dispatch git commit: DISPATCH-350 Fix rate calculation for links
Date Fri, 02 Sep 2016 16:16:13 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/master d356593fe -> ddc85fab8


DISPATCH-350 Fix rate calculation for links


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

Branch: refs/heads/master
Commit: ddc85fab8ffdc2e78a1ba5f586adafeb1ddb2445
Parents: d356593
Author: Ernest Allen <eallen@redhat.com>
Authored: Fri Sep 2 12:15:52 2016 -0400
Committer: Ernest Allen <eallen@redhat.com>
Committed: Fri Sep 2 12:15:52 2016 -0400

----------------------------------------------------------------------
 console/stand-alone/plugin/js/qdrOverview.js | 13 +++++++------
 console/stand-alone/plugin/js/qdrService.js  |  2 +-
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/ddc85fab/console/stand-alone/plugin/js/qdrOverview.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrOverview.js b/console/stand-alone/plugin/js/qdrOverview.js
index 6d50170..a187b9c 100644
--- a/console/stand-alone/plugin/js/qdrOverview.js
+++ b/console/stand-alone/plugin/js/qdrOverview.js
@@ -520,15 +520,16 @@ var QDR = (function (QDR) {
 			var nodeIds = QDRService.nodeIdList()
 			var linkFields = []
 			var now = Date.now()
-			var rate = function (response, result) {
+			var rate = function (linkName, response, result) {
 				if (!$scope.linkFields)
 					return 0;
-				var name = QDRService.valFor(response.attributeNames, result, "linkName")
 				var oldname = $scope.linkFields.filter(function (link) {
-					return link.linkName === name
+					return link.link === linkName
 				})
-				if (oldname.length > 0) {
+				if (oldname.length === 1) {
 					var elapsed = (now - oldname[0].timestamp) / 1000;
+					if (elapsed < 0)
+						return 0
 					var delivered = QDRService.valFor(response.attributeNames, result, "deliveryCount")
- oldname[0].rawDeliveryCount
 					//QDR.log.debug("elapsed " + elapsed + " delivered " + delivered)
 					return elapsed > 0 ? parseFloat(Math.round((delivered/elapsed) * 100) / 100).toFixed(2)
: 0;
@@ -553,7 +554,7 @@ var QDR = (function (QDR) {
 					var uncounts = function () {
 						var und = QDRService.valFor(response.attributeNames, result, "undeliveredCount")
 						var uns = QDRService.valFor(response.attributeNames, result, "unsettledCount")
-						return und + uns
+						return QDRService.pretty(und + uns)
 					}
 					var linkName = function () {
 						var namestr = QDRService.nameFromId(nodeName)
@@ -624,7 +625,7 @@ var QDR = (function (QDR) {
 							unsettledCount: QDRService.valFor(response.attributeNames, result, "unsettledCount"),
 							uid:     linkName,
 							timestamp: now,
-							rate: rate(response, result),
+							rate: QDRService.pretty(rate(linkName, response, result)),
 							nodeId: nodeName,
 							identity: QDRService.valFor(response.attributeNames, result, "identity")
 						})

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/ddc85fab/console/stand-alone/plugin/js/qdrService.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrService.js b/console/stand-alone/plugin/js/qdrService.js
index bcfd1ad..ba0c347 100644
--- a/console/stand-alone/plugin/js/qdrService.js
+++ b/console/stand-alone/plugin/js/qdrService.js
@@ -848,7 +848,7 @@ var QDR = (function(QDR) {
 			var connection;
 			try {
                 connection = self.rhea.connect({
-                    connection_details:ws('ws://' + baseAddress, ["binary", "AMQWSB10"]),
+                    connection_details:ws('ws://' + baseAddress, ["binary", "base64", "AMQWSB10"]),
                     reconnect:true,
                     properties: {console_identifier: 'Dispatch console'}
 	            });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message