activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject activemq git commit: [AMQ-6518] - fix up aveMessageSize dest stat and test
Date Fri, 25 Nov 2016 10:38:16 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 89c1a7b8b -> cfdff4edc


[AMQ-6518] - fix up aveMessageSize dest stat and test


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

Branch: refs/heads/master
Commit: cfdff4edc529984deea27067578810498541321c
Parents: 89c1a7b
Author: gtully <gary.tully@gmail.com>
Authored: Fri Nov 25 10:37:58 2016 +0000
Committer: gtully <gary.tully@gmail.com>
Committed: Fri Nov 25 10:38:09 2016 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/activemq/plugin/StatisticsBroker.java | 2 +-
 .../org/apache/activemq/plugin/BrokerStatisticsPluginTest.java     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/cfdff4ed/activemq-broker/src/main/java/org/apache/activemq/plugin/StatisticsBroker.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/plugin/StatisticsBroker.java
b/activemq-broker/src/main/java/org/apache/activemq/plugin/StatisticsBroker.java
index 9e41138..7476c3e 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/plugin/StatisticsBroker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/plugin/StatisticsBroker.java
@@ -120,7 +120,7 @@ public class StatisticsBroker extends BrokerFilter {
                         statsMessage.setLong("inflightCount", stats.getInflight().getCount());
                         statsMessage.setLong("messagesCached", stats.getMessagesCached().getCount());
                         // we are okay with the size without decimals so cast to long
-                        statsMessage.setLong("averageMessageSize", (long) stats.getMessageSize().getAveragePerSecond());
+                        statsMessage.setLong("averageMessageSize", (long) stats.getMessageSize().getAverageSize());
                         statsMessage.setInt("memoryPercentUsage", dest.getMemoryUsage().getPercentUsage());
                         statsMessage.setLong("memoryUsage", dest.getMemoryUsage().getUsage());
                         statsMessage.setLong("memoryLimit", dest.getMemoryUsage().getLimit());

http://git-wip-us.apache.org/repos/asf/activemq/blob/cfdff4ed/activemq-unit-tests/src/test/java/org/apache/activemq/plugin/BrokerStatisticsPluginTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/plugin/BrokerStatisticsPluginTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/plugin/BrokerStatisticsPluginTest.java
index b2e4bdd..b003a16 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/plugin/BrokerStatisticsPluginTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/plugin/BrokerStatisticsPluginTest.java
@@ -117,6 +117,8 @@ public class BrokerStatisticsPluginTest extends TestCase{
         assertTrue(reply.getMapNames().hasMoreElements());
         assertTrue(reply.getJMSTimestamp() > 0);
         assertEquals(Message.DEFAULT_PRIORITY, reply.getJMSPriority());
+        assertTrue(reply.getLong("averageMessageSize") > 0);
+
         /*
         for (Enumeration e = reply.getMapNames();e.hasMoreElements();) {
             String name = e.nextElement().toString();


Mime
View raw message