commit bd50405916441ff80732e307e03e9fe664d854a0 Author: Ana Custura ana@netstat.org.uk Date: Wed May 13 20:51:23 2020 +0100
Changes digit precision for payload_progress and payload_bytes field --- onionperf/analysis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/onionperf/analysis.py b/onionperf/analysis.py index 3b5af27..dfdf2a6 100644 --- a/onionperf/analysis.py +++ b/onionperf/analysis.py @@ -433,8 +433,8 @@ class Transfer(object): return None d = e.__dict__ if not e.is_error: - d['elapsed_seconds']['payload_progress'] = {decile: self.payload_progress[decile] - e.unix_ts_start for decile in self.payload_progress if self.payload_progress[decile] is not None} - d['elapsed_seconds']['payload_bytes'] = {partial: self.payload_bytes[partial] - e.unix_ts_start for partial in self.payload_bytes if self.payload_bytes[partial] is not None} + d['elapsed_seconds']['payload_progress'] = {decile: round(self.payload_progress[decile] - e.unix_ts_start, 6) for decile in self.payload_progress if self.payload_progress[decile] is not None} + d['elapsed_seconds']['payload_bytes'] = {partial: round(self.payload_bytes[partial] - e.unix_ts_start, 6) for partial in self.payload_bytes if self.payload_bytes[partial] is not None} return d
class Parser(object, metaclass=ABCMeta):
tor-commits@lists.torproject.org