summaryrefslogtreecommitdiff
path: root/qpid/python
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-12-03 20:42:38 +0000
committerTed Ross <tross@apache.org>2008-12-03 20:42:38 +0000
commit2897451bcf74c5a593e1d51f64fb1cb751b3060c (patch)
treeab70cef47385822e342f85e2d04cd9500f0896bd /qpid/python
parent59b696abbd5da5e5c2f44b127599a127cb8d13e3 (diff)
downloadqpid-python-2897451bcf74c5a593e1d51f64fb1cb751b3060c.tar.gz
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. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@723063 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
-rwxr-xr-xqpid/python/commands/qpid-queue-stats2
1 files changed, 2 insertions, 0 deletions
diff --git a/qpid/python/commands/qpid-queue-stats b/qpid/python/commands/qpid-queue-stats
index e8b9e4c36a..356a1d2d8d 100755
--- a/qpid/python/commands/qpid-queue-stats
+++ b/qpid/python/commands/qpid-queue-stats
@@ -95,6 +95,8 @@ class BrokerManager(Console):
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) / \