activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] activemq git commit: AMQ-5523: Average message size attribute on statistics plugin should not have decimals
Date Fri, 16 Jan 2015 09:11:36 GMT
AMQ-5523: Average message size attribute on statistics plugin should not have decimals


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

Branch: refs/heads/trunk
Commit: 5c7985c695407faecaced0cc147f7940dc901a05
Parents: dbf2c28
Author: Claus Ibsen <claus.ibsen@gmail.com>
Authored: Fri Jan 16 09:29:52 2015 +0100
Committer: Claus Ibsen <claus.ibsen@gmail.com>
Committed: Fri Jan 16 09:29:52 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/activemq/plugin/StatisticsBroker.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/5c7985c6/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 fdffa02..9e41138 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
@@ -119,7 +119,8 @@ public class StatisticsBroker extends BrokerFilter {
                         statsMessage.setLong("expiredCount", stats.getExpired().getCount());
                         statsMessage.setLong("inflightCount", stats.getInflight().getCount());
                         statsMessage.setLong("messagesCached", stats.getMessagesCached().getCount());
-                        statsMessage.setDouble("averageMessageSize", stats.getMessageSize().getAveragePerSecond());
+                        // we are okay with the size without decimals so cast to long
+                        statsMessage.setLong("averageMessageSize", (long) stats.getMessageSize().getAveragePerSecond());
                         statsMessage.setInt("memoryPercentUsage", dest.getMemoryUsage().getPercentUsage());
                         statsMessage.setLong("memoryUsage", dest.getMemoryUsage().getUsage());
                         statsMessage.setLong("memoryLimit", dest.getMemoryUsage().getLimit());
@@ -158,7 +159,8 @@ public class StatisticsBroker extends BrokerFilter {
                 statsMessage.setLong("dispatchCount", stats.getDispatched().getCount());
                 statsMessage.setLong("expiredCount", stats.getExpired().getCount());
                 statsMessage.setLong("inflightCount", stats.getInflight().getCount());
-                statsMessage.setDouble("averageMessageSize",stats.getMessageSize().getAverageSize());
+                // we are okay with the size without decimals so cast to long
+                statsMessage.setLong("averageMessageSize",(long) stats.getMessageSize().getAverageSize());
                 statsMessage.setLong("messagesCached", stats.getMessagesCached().getCount());
                 statsMessage.setInt("memoryPercentUsage", systemUsage.getMemoryUsage().getPercentUsage());
                 statsMessage.setLong("memoryUsage", systemUsage.getMemoryUsage().getUsage());


Mime
View raw message