[tor-commits] [onionperf/master] Removes payload_progress field in case of transfer errors

irl at torproject.org irl at torproject.org
Thu Apr 25 10:44:44 UTC 2019


commit b32ff68a99d06d22c86c68e64cfda737ea45afe3
Author: Ana C. Custura <ana at netstat.org.uk>
Date:   Mon Apr 22 16:23:46 2019 +0100

    Removes payload_progress field in case of transfer errors
---
 onionperf/analysis.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/onionperf/analysis.py b/onionperf/analysis.py
index 691a9cc..2c3c580 100644
--- a/onionperf/analysis.py
+++ b/onionperf/analysis.py
@@ -404,7 +404,8 @@ class Transfer(object):
         if e is None or not e.is_complete:
             return None
         d = e.__dict__
-        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}
+        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}
         return d
 
 class Parser(object):





More information about the tor-commits mailing list