You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by da...@apache.org on 2015/01/16 10:11:35 UTC

[1/2] activemq git commit: AMQ-5521: Average message size attribute on destination mbean should not have decimals

Repository: activemq
Updated Branches:
  refs/heads/trunk 3ec36818e -> 5c7985c69


AMQ-5521: Average message size attribute on destination mbean 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/dbf2c28b
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/dbf2c28b
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/dbf2c28b

Branch: refs/heads/trunk
Commit: dbf2c28b96e2e13a20ea682f758c6cb85227dd79
Parents: 3ec3681
Author: Claus Ibsen <cl...@gmail.com>
Authored: Fri Jan 16 09:22:28 2015 +0100
Committer: Claus Ibsen <cl...@gmail.com>
Committed: Fri Jan 16 09:22:28 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/activemq/broker/jmx/DestinationView.java    | 5 +++--
 .../org/apache/activemq/broker/jmx/DestinationViewMBean.java    | 3 +--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/dbf2c28b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
index ec6fe7c..8330231 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
@@ -161,8 +161,9 @@ public class DestinationView implements DestinationViewMBean {
     /**
      * @return the average size of a message (bytes)
      */
-    public double getAverageMessageSize() {
-        return destination.getDestinationStatistics().getMessageSize().getAverageSize();
+    public long getAverageMessageSize() {
+        // we are okay with the size without decimals so cast to long
+        return (long) destination.getDestinationStatistics().getMessageSize().getAverageSize();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/activemq/blob/dbf2c28b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
index a42bcfa..60340ff 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
@@ -264,12 +264,11 @@ public interface DestinationViewMBean {
     @MBeanInfo("The shortest time a message has been held this destination.")
     long getMinEnqueueTime();
 
-
     @MBeanInfo("Average time a message has been held this destination.")
     double getAverageEnqueueTime();
 
     @MBeanInfo("Average message size on this destination")
-    double getAverageMessageSize();
+    long getAverageMessageSize();
 
     @MBeanInfo("Max message size on this destination")
     public long getMaxMessageSize();


[2/2] activemq git commit: AMQ-5523: Average message size attribute on statistics plugin should not have decimals

Posted by da...@apache.org.
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 <cl...@gmail.com>
Authored: Fri Jan 16 09:29:52 2015 +0100
Committer: Claus Ibsen <cl...@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());