[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [onionperf/master] Changes digit precision for payload_progress and payload_bytes field



commit bd50405916441ff80732e307e03e9fe664d854a0
Author: Ana Custura <ana@xxxxxxxxxxxxxx>
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 mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits