From 4f9c68c8e2f8a791c83bdf2f4157e5bb1ce7cb71 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Wed, 3 Dec 2008 20:42:38 +0000 Subject: 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/qpid@723063 13f79535-47bb-0310-9956-ffa450edef68 --- python/commands/qpid-queue-stats | 2 ++ 1 file changed, 2 insertions(+) (limited to 'python/commands') diff --git a/python/commands/qpid-queue-stats b/python/commands/qpid-queue-stats index e8b9e4c36a..356a1d2d8d 100755 --- a/python/commands/qpid-queue-stats +++ b/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) / \ -- cgit v1.2.1