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 <[email protected]> Authored: Fri Jan 16 09:22:28 2015 +0100 Committer: Claus Ibsen <[email protected]> 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();
