From 2897451bcf74c5a593e1d51f64fb1cb751b3060c 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@723063 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/python/commands/qpid-queue-stats | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qpid/python') 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) / \ -- cgit v1.2.1