You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2017/06/03 08:43:48 UTC

qpid-broker-j git commit: QPID-7316: [Web Management] Add connection info to consumer table on the queue tab

Repository: qpid-broker-j
Updated Branches:
  refs/heads/master 8d9ba1c47 -> 60f062201


QPID-7316: [Web Management] Add connection info to consumer table on the queue tab

Also added consumer table details to the connection tab.


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/60f06220
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/60f06220
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/60f06220

Branch: refs/heads/master
Commit: 60f062201ee349ded188b697700ae3b677a62e88
Parents: 8d9ba1c
Author: Keith Wall <ke...@gmail.com>
Authored: Fri Jun 2 22:10:50 2017 +0100
Committer: Keith Wall <ke...@gmail.com>
Committed: Sat Jun 3 09:43:18 2017 +0100

----------------------------------------------------------------------
 .../org/apache/qpid/server/model/Consumer.java  |   6 +-
 .../apache/qpid/server/queue/QueueConsumer.java |   5 +
 .../src/main/java/resources/css/common.css      |  18 +++
 .../java/resources/js/qpid/common/formatter.js  |   7 +-
 .../main/java/resources/js/qpid/common/util.js  |  47 +++---
 .../resources/js/qpid/management/Connection.js  |  99 +++++++++++++
 .../java/resources/js/qpid/management/Queue.js  | 147 +++++++++++++------
 .../resources/js/qpid/management/VirtualHost.js |   8 +-
 .../src/main/java/resources/showConnection.html |   5 +-
 .../src/main/java/resources/showQueue.html      |  11 +-
 10 files changed, 267 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/60f06220/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java b/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java
index 2302665..9db4b21 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java
@@ -47,6 +47,9 @@ public interface Consumer<X extends Consumer<X,T>, T extends ConsumerTarget> ext
     @DerivedAttribute
     String getLinkName();
 
+    @DerivedAttribute
+    Session<?> getSession();
+
     @ManagedAttribute(immutable = true)
     String getDistributionMode();
 
@@ -79,9 +82,6 @@ public interface Consumer<X extends Consumer<X,T>, T extends ConsumerTarget> ext
     @ManagedStatistic(statisticType = StatisticType.POINT_IN_TIME, units = StatisticUnit.MESSAGES, label = "Prefetch")
     long getUnacknowledgedMessages();
 
-
-    AMQPSession<?,?> getSession();
-
     long getConsumerNumber();
 
     boolean isSuspended();

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/60f06220/broker-core/src/main/java/org/apache/qpid/server/queue/QueueConsumer.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/queue/QueueConsumer.java b/broker-core/src/main/java/org/apache/qpid/server/queue/QueueConsumer.java
index 882968b..cc060f5 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/queue/QueueConsumer.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/queue/QueueConsumer.java
@@ -24,6 +24,8 @@ import org.apache.qpid.server.consumer.ConsumerTarget;
 import org.apache.qpid.server.message.MessageInstance;
 import org.apache.qpid.server.model.Consumer;
 import org.apache.qpid.server.model.Queue;
+import org.apache.qpid.server.model.Session;
+import org.apache.qpid.server.session.AMQPSession;
 
 public interface QueueConsumer<X extends QueueConsumer<X,T>, T extends ConsumerTarget> extends Consumer<X, T>
 {
@@ -56,4 +58,7 @@ public interface QueueConsumer<X extends QueueConsumer<X,T>, T extends ConsumerT
     void notifyWork();
 
     void setQueueConsumerNode(QueueConsumerNode node);
+
+    @Override
+    AMQPSession<?,?> getSession();
 }

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/60f06220/broker-plugins/management-http/src/main/java/resources/css/common.css
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/css/common.css b/broker-plugins/management-http/src/main/java/resources/css/common.css
index 3e787df..21f6acd 100644
--- a/broker-plugins/management-http/src/main/java/resources/css/common.css
+++ b/broker-plugins/management-http/src/main/java/resources/css/common.css
@@ -521,6 +521,7 @@ td.advancedSearchField, col.autoWidth {
 }
 
 .claro.qpid .dgrid-header .dgrid-cell { font-weight: normal; }
+
 .virtualHostConnections .field-name { width: 20%; }
 .virtualHostConnections .field-principal { width: 10% }
 .virtualHostConnections .field-port { width: 10% }
@@ -531,6 +532,23 @@ td.advancedSearchField, col.autoWidth {
 .virtualHostConnections .field-msgOutRate { width: 10% }
 .virtualHostConnections .field-bytesOutRate { width: 10% }
 
+.queueConsumers .field-name { width: 30%; }
+.queueConsumers .field-distributionMode { width: 10% }
+.queueConsumers .field-connectionName { width: 10% }
+.queueConsumers .field-connectionPrincipal { width: 10% }
+.queueConsumers .field-unacknowledgedMessages { width: 10% }
+.queueConsumers .field-unacknowledgedBytes { width: 10% }
+.queueConsumers .field-msgOutRate { width: 10% }
+.queueConsumers .field-bytesOutRate { width: 10% }
+
+.connectionConsumers .field-name { width: 30%; }
+.connectionConsumers .field-distributionMode { width: 10% }
+.connectionConsumers .field-queueName { width: 20% }
+.connectionConsumers .field-unacknowledgedMessages { width: 10% }
+.connectionConsumers .field-unacknowledgedBytes { width: 10% }
+.connectionConsumers .field-msgOutRate { width: 10% }
+.connectionConsumers .field-bytesOutRate { width: 10% }
+
 .radioButtonIndent {
     padding-left: 20px;
     padding-top: 5px;

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/60f06220/broker-plugins/management-http/src/main/java/resources/js/qpid/common/formatter.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/common/formatter.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/common/formatter.js
index 3347e7e..59174c3 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/common/formatter.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/common/formatter.js
@@ -27,13 +27,16 @@ define(function ()
         {
             var returnVal = {
                 units: "B",
-                value: "0"
+                value: "0",
+                toString : function()
+                {
+                    return this.value + " " + this.units;
+                }
             };
 
             if (amount < 1000)
             {
                 returnVal.value = amount.toPrecision(3);
-                ;
             }
             else if (amount < 1000 * 1024)
             {

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/60f06220/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
index b6dbe9e..56e0379 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
@@ -175,7 +175,7 @@ define(["dojo/_base/xhr",
                 }
             }
             return confirmed;
-        }
+        };
 
         util.buildDeleteQuery = function (data, url, idParam)
         {
@@ -193,7 +193,7 @@ define(["dojo/_base/xhr",
                 queryParam += ( idParam || "id" ) + "=" + encodeURIComponent(data[i].id);
             }
             return url + queryParam;
-        }
+        };
 
         util.deleteSelectedObjects =
             function (grid, confirmationMessageStart, management, modelObj, updater, idParam, callback)
@@ -202,7 +202,7 @@ define(["dojo/_base/xhr",
                 {
                     util.deleteObjects(management, data, modelObj, idParam, grid, updater, callback);
                 });
-            }
+            };
 
         util.deleteObjects = function (management, data, modelObj, idParam, grid, updater, callback)
         {
@@ -227,7 +227,7 @@ define(["dojo/_base/xhr",
                         callback(data);
                     }
                 }, util.xhrErrorHandler);
-        }
+        };
 
         util.deleteSelectedRows = function (grid, confirmationMessageStart, management, url, updater, idParam, callback)
         {
@@ -235,7 +235,7 @@ define(["dojo/_base/xhr",
             {
                 util.deleteData(management, data, url, idParam, grid, updater, callback);
             });
-        }
+        };
 
         util.deleteData = function (management, data, url, idParam, grid, updater, callback)
         {
@@ -253,7 +253,7 @@ define(["dojo/_base/xhr",
                         callback(data);
                     }
                 }, util.xhrErrorHandler);
-        }
+        };
 
         util.findAllWidgets = function (root)
         {
@@ -285,11 +285,11 @@ define(["dojo/_base/xhr",
                     item.destroyRecursive();
                 });
                 dom.empty(tabData.contentPane.containerNode);
-            }
+            };
 
             var closeTab = function (e)
             {
-                tabData.contentPane.onClose()
+                tabData.contentPane.onClose();
                 tabData.tabContainer.removeChild(tabData.contentPane);
                 tabData.contentPane.destroyRecursive();
             };
@@ -297,7 +297,7 @@ define(["dojo/_base/xhr",
             util.responseErrorHandler(error, {
                 "404": util.warnOn404ErrorHandler(message, tabData.contentPane.containerNode, cleanUpTab, closeTab)
             });
-        }
+        };
 
         util.warnOn404ErrorHandler = function (message, containerNode, cleanUpCallback, onClickHandler)
         {
@@ -535,7 +535,7 @@ define(["dojo/_base/xhr",
                     util.parse(containerNode, template, postParseCallback);
                 }
             });
-        }
+        };
 
         util.parse = function (containerNode, template, postParseCallback)
         {
@@ -551,7 +551,7 @@ define(["dojo/_base/xhr",
                 {
                     console.error("Parse error:" + e);
                 });
-        }
+        };
         util.buildUI = function (containerNode, parent, htmlTemplateLocation, fieldNames, obj, postParseCallback)
         {
             this.parseHtmlIntoDiv(containerNode, htmlTemplateLocation, function ()
@@ -571,7 +571,7 @@ define(["dojo/_base/xhr",
                 }
             });
 
-        }
+        };
 
         util.updateUI = function (data, fieldNames, obj, formatters)
         {
@@ -598,7 +598,7 @@ define(["dojo/_base/xhr",
                     fieldNode.innerHTML = (value == undefined || value == null) ? "" : entities.encode(String(value));
                 }
             }
-        }
+        };
 
         util.applyMetadataToWidgets = function (domRoot, category, type, meta)
         {
@@ -621,7 +621,7 @@ define(["dojo/_base/xhr",
             {
                 widgetconfigurer.disableIfImmutable(widget, category, type, meta);
             });
-        }
+        };
 
         util.getFormWidgetValues = function (form, initialData)
         {
@@ -698,7 +698,7 @@ define(["dojo/_base/xhr",
                 }
             }
             return values;
-        }
+        };
 
         util.updateUpdatableStore = function (updatableStore, data)
         {
@@ -714,7 +714,7 @@ define(["dojo/_base/xhr",
                     updatableStore.grid.render();
                 }
             }
-        }
+        };
 
         util.makeTypeStore = function (types)
         {
@@ -728,7 +728,7 @@ define(["dojo/_base/xhr",
                 });
             }
             return new Memory({data: typeData});
-        }
+        };
 
         util.makeInstanceStore = function (management, parentCategory, category, callback)
         {
@@ -797,24 +797,24 @@ define(["dojo/_base/xhr",
                 // add new option to list
                 multiSelectWidget.appendChild(newOption);
             }
-        }
+        };
 
         var singleContextVarRegexp = "(\\${[\\w+\\.\\-:]+})";
 
         util.numericOrContextVarRegexp = function (constraints)
         {
             return "^(\\d+)|" + singleContextVarRegexp + "$";
-        }
+        };
 
         util.signedOrContextVarRegexp = function (constraints)
         {
             return "^(-?\\d+)|" + singleContextVarRegexp + "$";
-        }
+        };
 
         util.nameOrContextVarRegexp = function (constraints)
         {
             return "^(\\w+)|" + singleContextVarRegexp + "$";
-        }
+        };
 
         util.jdbcUrlOrContextVarRegexp = function (constraints)
         {
@@ -824,7 +824,7 @@ define(["dojo/_base/xhr",
         util.nodeAddressOrContextVarRegexp = function (constraints)
         {
             return "^(([0-9a-zA-Z.\\-_]|::)+:[0-9]{1,5})|" + singleContextVarRegexp + "$";
-        }
+        };
 
         util.resizeContentAreaAndRepositionDialog = function (contentNode, dialog)
         {
@@ -1020,7 +1020,6 @@ define(["dojo/_base/xhr",
                     evt.stopPropagation();
                 }
             });
-        }
-
+        };
         return util;
     });

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/60f06220/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Connection.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Connection.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Connection.js
index 364ce9e..5af855c 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Connection.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Connection.js
@@ -20,6 +20,7 @@
  */
 define(["dojo/parser",
         "dojo/query",
+        "dojo/_base/lang",
         "dojo/_base/connect",
         "dijit/registry",
         "qpid/common/properties",
@@ -27,11 +28,13 @@ define(["dojo/parser",
         "qpid/common/util",
         "qpid/common/formatter",
         "qpid/common/UpdatableStore",
+        "qpid/management/query/QueryGrid",
         "dojox/html/entities",
         "dojo/text!showConnection.html",
         "dojo/domReady!"],
     function (parser,
               query,
+              lang,
               connect,
               registry,
               properties,
@@ -39,6 +42,7 @@ define(["dojo/parser",
               util,
               formatter,
               UpdatableStore,
+              QueryGrid,
               entities,
               template)
     {
@@ -104,6 +108,7 @@ define(["dojo/parser",
             var that = this;
             this.tabObject = connectionTab;
             this.contentPane = connectionTab.contentPane;
+            this.controller = connectionTab.controller;
             this.management = connectionTab.controller.management;
             this.modelObj = connectionTab.modelObj;
             var containerNode = connectionTab.contentPane.containerNode;
@@ -193,6 +198,58 @@ define(["dojo/parser",
                 }
             }]);
 
+            this.consumersGrid = new QueryGrid({
+                detectChanges: true,
+                rowsPerPage: 10,
+                transformer: lang.hitch(this, this._transformConsumerData),
+                management: this.management,
+                parentObject: this.modelObj,
+                category: "Consumer",
+                selectClause: "id, name, distributionMode, $parent.id AS queueId, $parent.name AS queueName, "
+                              + "messagesOut, bytesOut, unacknowledgedMessages, unacknowledgedBytes",
+                where: "to_string(session.$parent.id) = '" + this.modelObj.id + "'",
+                orderBy: "name",
+                columns: [{
+                    label: "Name",
+                    field: "name"
+                }, {
+                    label: "Mode",
+                    field: "distributionMode"
+                }, {
+                    label: "Queue",
+                    field: "queueName"
+                }, {
+                    label: "Unacknowledged (msgs)",
+                    field: "unacknowledgedMessages"
+                }, {
+                    label: "Unacknowledged (bytes)",
+                    field: "unacknowledgedBytes",
+                    formatter: formatter.formatBytes
+                }, {
+                    label: "Msgs Rate",
+                    field: "msgOutRate"
+                }, {
+                    label: "Bytes Rate",
+                    field: "bytesOutRate"
+                }
+                ]
+            }, findNode("consumers"));
+
+            this.consumersGrid.on('rowBrowsed',
+                lang.hitch(this, function(event)
+                {
+                    var queueId = this.consumersGrid.row(event.id).data.queueId;
+                    this.controller.showById(queueId);
+                }));
+            this.consumersGrid.startup();
+
+            // Add onShow handler to work around an issue with not rendering of grid columns before first update.
+            // It seems if dgrid is created when tab is not shown (not active) the grid columns are not rendered.
+            this.contentPane.on("show",
+                function()
+                {
+                    that.consumersGrid.resize();
+                });
         }
 
         ConnectionUpdater.prototype.updateHeader = function ()
@@ -226,6 +283,9 @@ define(["dojo/parser",
 
             var that = this;
 
+            this.consumersGrid.updateData();
+            this.consumersGrid.resize();
+
             that.management.load(this.modelObj,
                 {
                     excludeInheritedContext: true,
@@ -319,5 +379,44 @@ define(["dojo/parser",
                 });
         };
 
+        ConnectionUpdater.prototype._transformConsumerData = function (data)
+        {
+            var sampleTime = new Date();
+            var consumers = util.queryResultToObjects(data);
+            if (this._previousConsumerSampleTime)
+            {
+                var samplePeriod = sampleTime.getTime() - this._previousConsumerSampleTime.getTime();
+                for (var i = 0; i < consumers.length; i++)
+                {
+                    var consumer = consumers[i];
+                    var oldConsumer = null;
+                    for (var j = 0; j < this._previousConsumers.length; j++)
+                    {
+                        if (this._previousConsumers[j].id == consumer.id)
+                        {
+                            oldConsumer = this._previousConsumers[j];
+                            break;
+                        }
+                    }
+                    var msgOutRate = 0;
+                    var bytesOutRate = 0;
+
+                    if (oldConsumer)
+                    {
+                        msgOutRate = (1000 * (consumer.messagesOut - oldConsumer.messagesOut))
+                                     / samplePeriod;
+                        bytesOutRate = (1000 * (consumer.bytesOut - oldConsumer.bytesOut)) / samplePeriod;
+                    }
+
+                    consumer.msgOutRate = msgOutRate.toFixed(0) + " msg/s";
+                    var bytesOutRateFormat = formatter.formatBytes(bytesOutRate);
+                    consumer.bytesOutRate = bytesOutRateFormat.value + " " + bytesOutRateFormat.units + "/s";
+                }
+            }
+            this._previousConsumerSampleTime = sampleTime;
+            this._previousConsumers = consumers;
+            return consumers;
+        };
+
         return Connection;
     });

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/60f06220/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js
index 3ecdef5..d68ed2a 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js
@@ -38,6 +38,7 @@ define(["dojo/_base/declare",
         "qpid/management/editQueue",
         "qpid/common/JsonRest",
         "dojox/grid/EnhancedGrid",
+        "qpid/management/query/QueryGrid",
         "dojo/data/ObjectStore",
         "dojox/html/entities",
         "dojo/text!showQueue.html",
@@ -64,6 +65,7 @@ define(["dojo/_base/declare",
               editQueue,
               JsonRest,
               EnhancedGrid,
+              QueryGrid,
               ObjectStore,
               entities,
               template)
@@ -359,6 +361,7 @@ define(["dojo/_base/declare",
         {
             var that = this;
             this.management = tabObject.management;
+            this.controller = tabObject.controller;
             this.modelObj = tabObject.modelObj;
             this.tabObject = tabObject;
             this.contentPane = tabObject.contentPane;
@@ -437,24 +440,62 @@ define(["dojo/_base/declare",
                 }
             }]);
 
-            that.consumersGrid = new UpdatableStore([], findNode("consumers"), [{
-                name: "Name",
-                field: "name",
-                width: "40%"
-            }, {
-                name: "Mode",
-                field: "distributionMode",
-                width: "20%"
-            }, {
-                name: "Msgs Rate",
-                field: "msgRate",
-                width: "20%"
-            }, {
-                name: "Bytes Rate",
-                field: "bytesRate",
-                width: "20%"
-            }]);
-
+            this.consumersGrid = new QueryGrid({
+                detectChanges: true,
+                rowsPerPage: 10,
+                transformer: lang.hitch(this, this._transformConsumerData),
+                management: this.management,
+                parentObject: this.modelObj,
+                category: "Consumer",
+                selectClause: "id, name, distributionMode, "
+                              + "session.$parent.id AS connectionId, session.$parent.name AS connectionName, session.$parent.principal AS connectionPrincipal,"
+                              + "messagesOut, bytesOut, unacknowledgedMessages, unacknowledgedBytes",
+                where: "to_string($parent.id) = '" + this.modelObj.id + "'",
+                orderBy: "name",
+                columns: [{
+                    label: "Name",
+                    field: "name"
+                }, {
+                    label: "Mode",
+                    field: "distributionMode"
+                }, {
+                    label: "Connection",
+                    field: "connectionName"
+                },{
+                    label: "User",
+                    field: "connectionPrincipal"
+                }, {
+                    label: "Unacknowledged (msgs)",
+                    field: "unacknowledgedMessages"
+                }, {
+                    label: "Unacknowledged (bytes)",
+                    field: "unacknowledgedBytes",
+                    formatter: formatter.formatBytes
+                }, {
+                    label: "Msgs Rate",
+                    field: "msgOutRate"
+                }, {
+                    label: "Bytes Rate",
+                    field: "bytesOutRate"
+                }
+                ]
+            }, findNode("consumers"));
+
+            this.consumersGrid.on('rowBrowsed',
+                                  lang.hitch(this, function(event)
+                                  {
+                                      var connectionId = this.consumersGrid.row(event.id).data.connectionId;
+                                      this.controller.showById(connectionId);
+                                  }));
+            this.consumersGrid.startup();
+
+            // Add onShow handler to work around an issue with not rendering of grid columns before first update.
+            // It seems if dgrid is created when tab is not shown (not active) the grid columns are not rendered.
+            this.contentPane.on("show",
+                function()
+                {
+                    that.consumersGrid.resize();
+                });
         }
 
         function renderMaximumQueueDepthMessages(valueElement, value, bytes)
@@ -584,6 +625,9 @@ define(["dojo/_base/declare",
 
             var thisObj = this;
 
+            thisObj.consumersGrid.updateData();
+            thisObj.consumersGrid.resize();
+
             var queuePromise = this.management.load(this.modelObj, {excludeInheritedContext: true, depth: 1 });
             var publishingLinkPromise = this.management.load({type: "queue", name: "getPublishingLinks", parent: this.modelObj});
 
@@ -655,30 +699,6 @@ define(["dojo/_base/declare",
                         var bytesOutFormat = formatter.formatBytes(bytesOutRate);
                         thisObj.bytesOutRate.innerHTML = "(" + bytesOutFormat.value;
                         thisObj.bytesOutRateUnits.innerHTML = bytesOutFormat.units + "/s)";
-
-                        if (consumers && thisObj.consumers)
-                        {
-                            for (i = 0; i < consumers.length; i++)
-                            {
-                                var consumer = consumers[i];
-                                for (j = 0; j < thisObj.consumers.length; j++)
-                                {
-                                    var oldConsumer = thisObj.consumers[j];
-                                    if (oldConsumer.id == consumer.id)
-                                    {
-                                        var msgRate = (1000 * (consumer.messagesOut - oldConsumer.messagesOut))
-                                                      / samplePeriod;
-                                        consumer.msgRate = msgRate.toFixed(0) + "msg/s";
-
-                                        var bytesRate = (1000 * (consumer.bytesOut - oldConsumer.bytesOut))
-                                                        / samplePeriod;
-                                        var bytesRateFormat = formatter.formatBytes(bytesRate);
-                                        consumer.bytesRate = bytesRateFormat.value + bytesRateFormat.units + "/s";
-                                    }
-                                }
-                            }
-                        }
-
                     }
 
                     thisObj.sampleTime = sampleTime;
@@ -690,10 +710,6 @@ define(["dojo/_base/declare",
 
                     // update bindings
                     thisObj.bindingsGrid.update(bindings);
-
-                    // update consumers
-                    thisObj.consumersGrid.update(thisObj.queueData.consumers)
-
                 }, function (error)
                 {
                     util.tabErrorHandler(error, {
@@ -706,6 +722,45 @@ define(["dojo/_base/declare",
                 });
         };
 
+        QueueUpdater.prototype._transformConsumerData = function (data)
+        {
+            var sampleTime = new Date();
+            var consumers = util.queryResultToObjects(data);
+            if (this._previousConsumerSampleTime)
+            {
+                var samplePeriod = sampleTime.getTime() - this._previousConsumerSampleTime.getTime();
+                for (var i = 0; i < consumers.length; i++)
+                {
+                    var consumer = consumers[i];
+                    var oldConsumer = null;
+                    for (var j = 0; j < this._previousConsumers.length; j++)
+                    {
+                        if (this._previousConsumers[j].id == consumer.id)
+                        {
+                            oldConsumer = this._previousConsumers[j];
+                            break;
+                        }
+                    }
+                    var msgOutRate = 0;
+                    var bytesOutRate = 0;
+
+                    if (oldConsumer)
+                    {
+                        msgOutRate = (1000 * (consumer.messagesOut - oldConsumer.messagesOut))
+                                     / samplePeriod;
+                        bytesOutRate = (1000 * (consumer.bytesOut - oldConsumer.bytesOut)) / samplePeriod;
+                    }
+
+                    consumer.msgOutRate = msgOutRate.toFixed(0) + " msg/s";
+                    var bytesOutRateFormat = formatter.formatBytes(bytesOutRate);
+                    consumer.bytesOutRate = bytesOutRateFormat.value + " " + bytesOutRateFormat.units + "/s";
+                }
+            }
+            this._previousConsumerSampleTime = sampleTime;
+            this._previousConsumers = consumers;
+            return consumers;
+        };
+
         Queue.prototype.deleteQueue = function ()
         {
             if (confirm("Are you sure you want to delete queue '" + this.name + "'?"))

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/60f06220/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js
index aa96574..b28162c 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js
@@ -580,11 +580,11 @@ define(["dojo/parser",
                 {
                     var connection = connections[i];
                     var oldConnection = null;
-                    for (var j = 0; j < this._previousConnections.length; j++)
+                    for (var j = 0; j < this._previousConsumers.length; j++)
                     {
-                        if (this._previousConnections[j].id == connection.id)
+                        if (this._previousConsumers[j].id == connection.id)
                         {
-                            oldConnection = this._previousConnections[j];
+                            oldConnection = this._previousConsumers[j];
                             break;
                         }
                     }
@@ -611,7 +611,7 @@ define(["dojo/parser",
                 }
             }
             this._previousConnectionSampleTime = sampleTime;
-            this._previousConnections = connections;
+            this._previousConsumers = connections;
             return connections;
         };
 

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/60f06220/broker-plugins/management-http/src/main/java/resources/showConnection.html
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/showConnection.html b/broker-plugins/management-http/src/main/java/resources/showConnection.html
index 048581a..6793e77 100644
--- a/broker-plugins/management-http/src/main/java/resources/showConnection.html
+++ b/broker-plugins/management-http/src/main/java/resources/showConnection.html
@@ -92,7 +92,7 @@
         <button data-dojo-type="dijit.form.Button" class="closeButton" data-dojo-props="iconClass: 'dijitIconDelete'">Close</button>
     </div>
 
-    <div class="clear"/>
+    <div class="clear"></div>
 
     <br/>
 
@@ -100,5 +100,8 @@
         <div class="sessions"></div>
     </div>
     <br/>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Consumers'" class="connectionConsumers">
+        <div class="consumers"></div>
+    </div>
 
 </div>

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/60f06220/broker-plugins/management-http/src/main/java/resources/showQueue.html
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/showQueue.html b/broker-plugins/management-http/src/main/java/resources/showQueue.html
index fb389ee..9ba180a 100644
--- a/broker-plugins/management-http/src/main/java/resources/showQueue.html
+++ b/broker-plugins/management-http/src/main/java/resources/showQueue.html
@@ -147,13 +147,17 @@
         </div>
         <div class="clear"></div>
     </div>
+    <div class="dijitDialogPaneActionBar">
+        <button data-dojo-type="dijit.form.Button" class="editQueueButton" type="button">Edit Queue</button>
+        <button data-dojo-type="dijit.form.Button" class="deleteQueueButton" type="button">Delete Queue</button>
+    </div>
     <br/>
     <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Bindings'">
         <div class="bindings"></div>
         <button data-dojo-type="dijit.form.Button" class="addBindingButton" type="button">Add Binding</button>
     </div>
     <br/>
-    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Consumers'">
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Consumers'" class="queueConsumers">
         <div class="consumers"></div>
     </div>
     <br/>
@@ -205,10 +209,5 @@
         </div>
         <div class="clear"></div>
     </div>
-
-    <div class="dijitDialogPaneActionBar">
-        <button data-dojo-type="dijit.form.Button" class="editQueueButton" type="button">Edit Queue</button>
-        <button data-dojo-type="dijit.form.Button" class="deleteQueueButton" type="button">Delete Queue</button>
-    </div>
 </div>
 


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