Commit b9dbc158 authored by Karsten Loesing's avatar Karsten Loesing
Browse files

Fix visualizations.

Turns out that stream_info/recvsize contains a string, not an int.
parent 0189c3a7
......@@ -70,12 +70,12 @@ 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"]
# Explanation of the math below for computing Mbps: From filesize_bytes
# and payload_progress fields we can compute the number of seconds that
# Explanation of the math below for computing Mbps: From stream_info/recvsize
# and payload_progress_recv fields we can compute 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 that value with unit megabits per second.
if stream_data["stream_info"]["recvsize"] == 5242880 and "0.2" in s["payload_progress_recv"]:
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 "error" in stream_data["transport_info"] and stream_data["transport_info"]["error"] != "NONE":
stream["error_code"] = stream_data["transport_info"]["error"]
......
Supports Markdown
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