activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1443669 - /activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/IntMetricCounter.scala
Date Thu, 07 Feb 2013 19:15:25 GMT
Author: chirino
Date: Thu Feb  7 19:15:25 2013
New Revision: 1443669

URL: http://svn.apache.org/r1443669
Log:
Fixes: APLO-295: Incorrect message_load_batch_size.max

Modified:
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/IntMetricCounter.scala

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/IntMetricCounter.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/IntMetricCounter.scala?rev=1443669&r1=1443668&r2=1443669&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/IntMetricCounter.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/IntMetricCounter.scala
Thu Feb  7 19:15:25 2013
@@ -31,11 +31,15 @@ class IntMetricCounter extends MetricPro
   private var count = 0
 
   def apply(reset: Boolean):IntMetric = {
-    val rc = IntMetric(count, total, min, max)
-    if (reset) {
-      clear()
+    if( count == 0 ) {
+      IntMetric(0, 0, 0, 0)
+    } else {
+      val rc = IntMetric(count, total, min, max)
+      if (reset) {
+        clear()
+      }
+      rc
     }
-    rc
   }
 
   def clear() = {



Mime
View raw message