Author: tross
Date: Wed Dec  3 12:42:38 2008
New Revision: 723063

URL: http://svn.apache.org/viewvc?rev=723063&view=rev
Log:
Avoid a divide-by-zero that can occur if updates are sent with a timestamp
equal to the last update.  This can occur when running qpid-queue-stats and
then running qpid-tool on the same broker.

Modified:
    incubator/qpid/trunk/qpid/python/commands/qpid-queue-stats

Modified: incubator/qpid/trunk/qpid/python/commands/qpid-queue-stats
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/commands/qpid-queue-stats?rev=723063&r1=723062&r2=723063&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/commands/qpid-queue-stats (original)
+++ incubator/qpid/trunk/qpid/python/commands/qpid-queue-stats Wed Dec  3 
12:42:38 2008
@@ -95,6 +95,8 @@
     self.objects[id] = (name, first, record)
 
     deltaTime   = float (record.getTimestamps()[0] - 
lastSample.getTimestamps()[0])
+    if deltaTime < 1000000000.0:
+      return
     enqueueRate = float (record.msgTotalEnqueues - 
lastSample.msgTotalEnqueues) / \
         (deltaTime / 1000000000.0)
     dequeueRate = float (record.msgTotalDequeues - 
lastSample.msgTotalDequeues) / \


Reply via email to