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
b275641f
Commit
b275641f
authored
Apr 08, 2018
by
Matt Traudt
Browse files
Fix an assert and add another
parent
409d85e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
sbws/commands/generate.py
View file @
b275641f
...
...
@@ -51,7 +51,7 @@ def warn_if_not_accurate_enough(lines, constant):
def
scale_lines
(
args
,
v3bw_lines
):
assert
len
(
v3bw_lines
>
0
)
assert
len
(
v3bw_lines
)
>
0
total
=
sum
([
l
.
bw
for
l
in
v3bw_lines
])
# In case total is zero, it will run on ZeroDivision
assert
total
>
0
...
...
@@ -90,6 +90,7 @@ def gen_parser(sub):
def
log_stats
(
data_lines
):
assert
len
(
data_lines
)
>
0
total_bw
=
sum
([
l
.
bw
for
l
in
data_lines
])
bw_per_line
=
total_bw
/
len
(
data_lines
)
/
1024
log
.
info
(
'Mean bandwidth per line: {:.2f} "KiB"'
.
format
(
bw_per_line
))
...
...
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