diff options
| author | Darryl L. Pierce <mcpierce@apache.org> | 2013-09-18 21:15:16 +0000 |
|---|---|---|
| committer | Darryl L. Pierce <mcpierce@apache.org> | 2013-09-18 21:15:16 +0000 |
| commit | 199bdab9674606e379654db00913cc27ff702a92 (patch) | |
| tree | 09133c98d6d6e4959a881b4ed88f419432329dc4 /python/examples/api/statistics.py | |
| parent | aa0e0128fe64a766e93d00824f4dee1951a1ea71 (diff) | |
| download | qpid-python-199bdab9674606e379654db00913cc27ff702a92.tar.gz | |
QPID-4924: Fixed the Python examples to use the new Python module
Now the imports will first attempt to bring in qpid_messaging, the Swig
generated Python. If that fails it will then fall back to trying to
import qpid.messaging, the pure Python binding.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1524572 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/examples/api/statistics.py')
| -rw-r--r-- | python/examples/api/statistics.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/python/examples/api/statistics.py b/python/examples/api/statistics.py index e095920e90..089b81b740 100644 --- a/python/examples/api/statistics.py +++ b/python/examples/api/statistics.py @@ -48,16 +48,16 @@ class Throughput(Statistic): return "tp(m/s)" def report(self): - if self.started: + if self.started: elapsed = time.time() - self.start return str(int(self.messages/elapsed)) - else: - return "0" + else: + return "0" class ThroughputAndLatency(Throughput): def __init__(self): - Throughput.__init__(self) + Throughput.__init__(self) self.total = 0.0 self.min = float('inf') self.max = -float('inf') @@ -82,8 +82,8 @@ class ThroughputAndLatency(Throughput): def report(self): output = Throughput.report(self) if (self.samples > 0): - output += "\t%.2f\t%.2f\t%.2f" %(self.min, self.max, self.total/self.samples) - return output + output += "\t%.2f\t%.2f\t%.2f" %(self.min, self.max, self.total/self.samples) + return output # Report batch and overall statistics |
