activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject git commit: AMQ-4831: Use long value for average message size on borker (JMX) like min/max values also is.
Date Fri, 07 Mar 2014 15:12:03 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 82fb18d0d -> 37eb6b0c6


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


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

Branch: refs/heads/trunk
Commit: 37eb6b0c6efaee01e8c8b8baede8dee12c951746
Parents: 82fb18d
Author: Claus Ibsen <claus.ibsen@gmail.com>
Authored: Fri Mar 7 16:14:23 2014 +0100
Committer: Claus Ibsen <claus.ibsen@gmail.com>
Committed: Fri Mar 7 16:14:23 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/activemq/blob/37eb6b0c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
index b0ddf70..852120f 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
@@ -163,8 +163,9 @@ public class BrokerView implements BrokerViewMBean {
      * @return the average size of a message (bytes)
      */
     @Override
-    public double getAverageMessageSize() {
-        return safeGetBroker().getDestinationStatistics().getMessageSize().getAverageSize();
+    public long getAverageMessageSize() {
+        // we are okay with the size without decimals so cast to long
+        return (long) safeGetBroker().getDestinationStatistics().getMessageSize().getAverageSize();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/activemq/blob/37eb6b0c/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java
index f3fc378..bfdb3cb 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java
@@ -100,7 +100,7 @@ public interface BrokerViewMBean extends Service {
     long getTotalMessageCount();
 
     @MBeanInfo("Average message size on this broker")
-    double getAverageMessageSize();
+    long getAverageMessageSize();
 
     @MBeanInfo("Max message size on this broker")
     public long getMaxMessageSize();


Mime
View raw message