From dbf2c28b96e2e13a20ea682f758c6cb85227dd79 Mon Sep 17 00:00:00 2001 From: Claus Ibsen Date: Fri, 16 Jan 2015 09:22:28 +0100 Subject: [PATCH] AMQ-5521: Average message size attribute on destination mbean should not have decimals --- .../java/org/apache/activemq/broker/jmx/DestinationView.java | 5 +++-- .../org/apache/activemq/broker/jmx/DestinationViewMBean.java | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 ec6fe7ccd8..8330231ee5 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(); } /** 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 a42bcfa6d5..60340ffe81 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();