[tor-commits] [onionperf/master] Update TTFB/TTLB definitions in visualizations.

karsten at torproject.org karsten at torproject.org
Thu May 28 18:51:31 UTC 2020


commit b3b4c5bb7fbe7ea8a177884e8d4712d3bded4757
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Tue May 26 09:42:42 2020 +0200

    Update TTFB/TTLB definitions in visualizations.
    
    We're now including the time that it takes for tor to establish a
    circuit and attach a stream in the time to first/last byte.
    
    Implements #34215.
---
 onionperf/visualization.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/onionperf/visualization.py b/onionperf/visualization.py
index 99a2f05..92727e3 100644
--- a/onionperf/visualization.py
+++ b/onionperf/visualization.py
@@ -56,11 +56,10 @@ class TGenVisualization(Visualization):
                                 "filesize_bytes": transfer_data["filesize_bytes"]}
                     if "elapsed_seconds" in transfer_data:
                         s = transfer_data["elapsed_seconds"]
-                        if "command" in s:
-                            if "first_byte" in s:
-                                transfer["time_to_first_byte"] = s["first_byte"] - s["command"]
-                            if "last_byte" in s:
-                                transfer["time_to_last_byte"] = s["last_byte"] - s["command"]
+                        if "first_byte" in s:
+                            transfer["time_to_first_byte"] = s["first_byte"]
+                        if "last_byte" in s:
+                            transfer["time_to_last_byte"] = s["last_byte"]
                     if "error_code" in transfer_data and transfer_data["error_code"] != "NONE":
                         transfer["error_code"] = transfer_data["error_code"]
                     if "unix_ts_start" in transfer_data:



More information about the tor-commits mailing list