Commit b79722a3 authored by Ana Custura's avatar Ana Custura
Browse files

Compute 5 MiB transfer throughput based on the last MiB of the response

parent e24155e1
# Changes in version 0.9 - 2020-1?-??
- Compute the throughput for 5 MiB transfers based on the elapsed time
between receiving 4 and 5 MiB of the response. Implemets #40020.
- Avoid tracebacks when visualizing analysis files containing only
unsuccessful measurements. Fixes #40012.
- Add support for processing GUARD events and including guard-related
......
......@@ -301,7 +301,7 @@ onionperf visualize --help
The PDF output file contains visualizations of the following metrics:
- Time to download first (last) byte, which is defined as elapsed time between starting a measurement and receiving the first (last) byte of the HTTP response.
- Throughput, which is computed from the elapsed time between receiving 0.5 and 1 MiB of the response.
- Throughput, which is computed from the elapsed time between receiving 0.5 and 1 MiB of the response for 1MiB transfers, and from the elapsed time between receiving 4 and 5 MiB of the response for 5MiB transfers.
- Number of downloads.
- Number and type of failures.
......
......@@ -86,10 +86,14 @@ class TGenVisualization(Visualization):
error_code = None
source_port = None
unix_ts_end = None
# Explanation of the math below for computing Mbps: For 1 MiB and 5 MiB
# Explanation of the math below for computing Mbps: For 1 MiB
# downloads we can extract the number of seconds that have elapsed between
# receiving bytes 524,288 and 1,048,576, which is a total amount of 524,288
# bytes or 4,194,304 bits or 4.194304 megabits. We want the reciprocal of
# bytes or 4,194,304 bits or 4.194304 megabits.
# For 5 MiB downloads we extract the number of seconds that have elapsed between
# receiving bytes 4,194,304 and 5,242,880, which is a total amount of 1,048,576
# bytes or 8,388,608 bits or 8.388608 megabits. We want the reciprocal of
# that value with unit megabits per second.
if tgen_streams:
stream_id, stream_data = tgen_streams.popitem()
......@@ -105,8 +109,8 @@ class TGenVisualization(Visualization):
stream["time_to_last_byte"] = float(s["usecs-to-last-byte-recv"])/1000000
if "elapsed_seconds" in stream_data:
s = stream_data["elapsed_seconds"]
if stream_data["stream_info"]["recvsize"] == "5242880" and "0.2" in s["payload_progress_recv"]:
stream["mbps"] = 4.194304 / (s["payload_progress_recv"]["0.2"] - s["payload_progress_recv"]["0.1"])
if stream_data["stream_info"]["recvsize"] == "5242880" and "1.0" in s["payload_progress_recv"]:
stream["mbps"] = 8.388608 / (s["payload_progress_recv"]["1.0"] - s["payload_progress_recv"]["0.8"])
if "error" in stream_data["stream_info"] and stream_data["stream_info"]["error"] != "NONE":
error_code = stream_data["stream_info"]["error"]
if "local" in stream_data["transport_info"] and len(stream_data["transport_info"]["local"].split(":")) > 2:
......@@ -126,8 +130,8 @@ class TGenVisualization(Visualization):
if "payload_progress" in s:
if transfer_data["filesize_bytes"] == 1048576 and "1.0" in s["payload_progress"]:
stream["mbps"] = 4.194304 / (s["payload_progress"]["1.0"] - s["payload_progress"]["0.5"])
if transfer_data["filesize_bytes"] == 5242880 and "0.2" in s["payload_progress"]:
stream["mbps"] = 4.194304 / (s["payload_progress"]["0.2"] - s["payload_progress"]["0.1"])
if transfer_data["filesize_bytes"] == 5242880 and "1.0" in s["payload_progress"]:
stream["mbps"] = 8.388608 / (s["payload_progress"]["1.0"] - s["payload_progress"]["0.8"])
if "first_byte" in s:
stream["time_to_first_byte"] = s["first_byte"]
if "last_byte" in s:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment