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
sbws
Commits
838a9d55
Commit
838a9d55
authored
Mar 21, 2018
by
Matt Traudt
Browse files
Include RTT in v3bw output
parent
d4e36b8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
generate-v3bw.py
View file @
838a9d55
...
...
@@ -19,14 +19,17 @@ def read_result_file(fname, starting_dict=None):
class
V3BWLine
:
def
__init__
(
self
,
fp
,
bw
,
nick
):
def
__init__
(
self
,
fp
,
bw
,
nick
,
rtts
):
self
.
fp
=
fp
self
.
bw
=
bw
self
.
nick
=
nick
# convert to ms
self
.
rtts
=
[
int
(
round
(
r
*
1000
))
for
r
in
rtts
]
def
__str__
(
self
):
frmt
=
'node_id={fp} bw={sp} nick={n}'
return
frmt
.
format
(
fp
=
self
.
fp
,
sp
=
round
(
self
.
bw
),
n
=
self
.
nick
)
frmt
=
'node_id={fp} bw={sp} nick={n} min_rtt={rtt}'
return
frmt
.
format
(
fp
=
self
.
fp
,
sp
=
round
(
self
.
bw
),
n
=
self
.
nick
,
rtt
=
min
(
self
.
rtts
))
def
result_data_to_v3bw_line
(
data
,
fingerprint
):
...
...
@@ -35,7 +38,8 @@ def result_data_to_v3bw_line(data, fingerprint):
nick
=
results
[
0
][
'nickname'
]
speeds
=
[
r
[
'amount'
]
/
r
[
'duration'
]
for
r
in
results
]
speed
=
median
(
speeds
)
return
V3BWLine
(
fingerprint
,
speed
,
nick
)
rtts
=
[
rtt
for
r
in
results
for
rtt
in
r
[
'rtts'
]]
return
V3BWLine
(
fingerprint
,
speed
,
nick
,
rtts
)
def
scale_lines
(
v3bw_lines
,
scale_max
):
...
...
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