diff options
| author | Ted Ross <tross@apache.org> | 2008-12-03 20:42:38 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2008-12-03 20:42:38 +0000 |
| commit | 4f9c68c8e2f8a791c83bdf2f4157e5bb1ce7cb71 (patch) | |
| tree | 32f3b31bac5a21fe498a4bd64bf12e0080fe02ff /python/commands | |
| parent | 78da7fc1df9d1995512b2d08ff0bc11daf7cf220 (diff) | |
| download | qpid-python-4f9c68c8e2f8a791c83bdf2f4157e5bb1ce7cb71.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/qpid@723063 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/commands')
| -rwxr-xr-x | python/commands/qpid-queue-stats | 2 |
1 files changed, 2 insertions, 0 deletions
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) / \ |
