Author: gsim
Date: Thu Oct 23 01:39:13 2008
New Revision: 707311

URL: http://svn.apache.org/viewvc?rev=707311&view=rev
Log:
More complete fix to prevention of divide by zero when the sampling rate is 
more frequent than once per second.


Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/RateTracker.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/RateTracker.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/RateTracker.cpp?rev=707311&r1=707310&r2=707311&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/RateTracker.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/RateTracker.cpp Thu Oct 23 
01:39:13 2008
@@ -43,7 +43,7 @@
     lastCount = currentCount;
     lastTime = now;
     //if sampling at higher frequency than supported, will just return the 
number of increments
-    if (interval == 0) return increment;
+    if (interval < TIME_SEC) return increment;
     else if (increment == 0) return 0;
     else return increment / (interval / TIME_SEC);
 }


Reply via email to