Rev 16: Small fixes. in file:///v/home/vila/.bazaar/plugins/transportstats/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon Oct 8 11:35:17 BST 2007
At file:///v/home/vila/.bazaar/plugins/transportstats/
------------------------------------------------------------
revno: 16
revision-id: v.ladeuil+lp at free.fr-20071008103516-c9gs7qecktcnjhyx
parent: v.ladeuil+lp at free.fr-20071008094616-okycd9tkn2wocjwj
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: transportstats
timestamp: Mon 2007-10-08 12:35:16 +0200
message:
Small fixes.
* stats.py:
(Stats.collect): Oops, avoid divide-by-zero ;)
* decorator.py:
(StatsCollector.__init__): Just use *args for better
backward/forward compatibility.
modified:
decorator.py decorator.py-20070926152401-52kuiex1mu755ajk-1
stats.py stats.py-20070928061304-7i3r2h4gg6rbi03e-1
-------------- next part --------------
=== modified file 'decorator.py'
--- a/decorator.py 2007-10-08 09:46:16 +0000
+++ b/decorator.py 2007-10-08 10:35:16 +0000
@@ -46,9 +46,9 @@
sending and response receiving.
"""
- def __init__(self, url, _decorated=None):
+ def __init__(self, *args):
"See TransportDecorator.__init__"""
- super(StatsCollector, self).__init__(url, _decorated)
+ super(StatsCollector, self).__init__(*args)
self._stats = stats.get_stats()
self._stats.start_collecting()
self.__start_time = 0
=== modified file 'stats.py'
--- a/stats.py 2007-10-08 09:46:16 +0000
+++ b/stats.py 2007-10-08 10:35:16 +0000
@@ -261,7 +261,10 @@
except:
pass
requests += stat.requests
- return requests, bytes_read, (total_latency / latency_count)
+ avg_latency = 0
+ if latency_count:
+ avg_latency = total_latency / latency_count
+ return requests, bytes_read, avg_latency
_stats = None
More information about the bazaar-commits
mailing list