Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Network Health
Metrics
Onionperf
Commits
b9dbc158
Commit
b9dbc158
authored
Jul 12, 2020
by
Karsten Loesing
Browse files
Fix visualizations.
Turns out that stream_info/recvsize contains a string, not an int.
parent
0189c3a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
onionperf/visualization.py
View file @
b9dbc158
...
...
@@ -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"
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment