AMQ-4831: Use long value for average message size on borker (JMX) like min/max values also is.

This commit is contained in:
Claus Ibsen 2014-03-07 16:14:23 +01:00
parent 82fb18d0d1
commit 37eb6b0c6e
2 changed files with 4 additions and 3 deletions

View File

@ -163,8 +163,9 @@ public class BrokerView implements BrokerViewMBean {
* @return the average size of a message (bytes) * @return the average size of a message (bytes)
*/ */
@Override @Override
public double getAverageMessageSize() { public long getAverageMessageSize() {
return safeGetBroker().getDestinationStatistics().getMessageSize().getAverageSize(); // we are okay with the size without decimals so cast to long
return (long) safeGetBroker().getDestinationStatistics().getMessageSize().getAverageSize();
} }
/** /**

View File

@ -100,7 +100,7 @@ public interface BrokerViewMBean extends Service {
long getTotalMessageCount(); long getTotalMessageCount();
@MBeanInfo("Average message size on this broker") @MBeanInfo("Average message size on this broker")
double getAverageMessageSize(); long getAverageMessageSize();
@MBeanInfo("Max message size on this broker") @MBeanInfo("Max message size on this broker")
public long getMaxMessageSize(); public long getMaxMessageSize();