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
juga
sbws
Commits
e0532a96
Commit
e0532a96
authored
Oct 23, 2018
by
juga
Browse files
Allow 0 RTT measurements
To speed up the scanner. RTT is not being used at the moment, set the default to 0.
parent
1defb776
Changes
4
Show whitespace changes
Inline
Side-by-side
sbws/config.default.ini
View file @
e0532a96
...
@@ -42,7 +42,7 @@ download_min = 5
...
@@ -42,7 +42,7 @@ download_min = 5
download_target
=
6
download_target
=
6
download_max
=
10
download_max
=
10
# How many RTT measurements to make
# How many RTT measurements to make
num_rtts
=
1
0
num_rtts
=
0
# Number of downloads with acceptable times we must have for a relay before
# Number of downloads with acceptable times we must have for a relay before
# moving on
# moving on
num_downloads
=
5
num_downloads
=
5
...
...
sbws/lib/resultdump.py
View file @
e0532a96
...
@@ -476,7 +476,7 @@ class ResultSuccess(Result):
...
@@ -476,7 +476,7 @@ class ResultSuccess(Result):
def
from_dict
(
d
):
def
from_dict
(
d
):
assert
isinstance
(
d
,
dict
)
assert
isinstance
(
d
,
dict
)
return
ResultSuccess
(
return
ResultSuccess
(
d
[
'rtts'
],
d
[
'downloads'
],
d
[
'rtts'
]
or
[]
,
d
[
'downloads'
],
Result
.
Relay
(
Result
.
Relay
(
d
[
'fingerprint'
],
d
[
'nickname'
],
d
[
'address'
],
d
[
'fingerprint'
],
d
[
'nickname'
],
d
[
'address'
],
d
[
'master_key_ed25519'
],
d
[
'relay_average_bandwidth'
],
d
[
'master_key_ed25519'
],
d
[
'relay_average_bandwidth'
],
...
...
sbws/lib/v3bwfile.py
View file @
e0532a96
...
@@ -302,7 +302,9 @@ class V3BWLine(object):
...
@@ -302,7 +302,9 @@ class V3BWLine(object):
return
None
return
None
kwargs
[
'desc_avg_bw_bs'
]
=
\
kwargs
[
'desc_avg_bw_bs'
]
=
\
results_recent
[
-
1
].
relay_average_bandwidth
results_recent
[
-
1
].
relay_average_bandwidth
kwargs
[
'rtt'
]
=
cls
.
rtt_from_results
(
results_recent
)
rtt
=
cls
.
rtt_from_results
(
results_recent
)
if
rtt
:
kwargs
[
'rtt'
]
=
rtt
bw
=
cls
.
bw_bs_median_from_results
(
results_recent
)
bw
=
cls
.
bw_bs_median_from_results
(
results_recent
)
kwargs
[
'bw_bs_mean'
]
=
cls
.
bw_bs_mean_from_results
(
results_recent
)
kwargs
[
'bw_bs_mean'
]
=
cls
.
bw_bs_mean_from_results
(
results_recent
)
kwargs
[
'bw_bs_median'
]
=
cls
.
bw_bs_median_from_results
(
kwargs
[
'bw_bs_median'
]
=
cls
.
bw_bs_median_from_results
(
...
@@ -380,7 +382,7 @@ class V3BWLine(object):
...
@@ -380,7 +382,7 @@ class V3BWLine(object):
def
rtt_from_results
(
results
):
def
rtt_from_results
(
results
):
# convert from miliseconds to seconds
# convert from miliseconds to seconds
rtts
=
[(
round
(
rtt
*
1000
))
for
r
in
results
for
rtt
in
r
.
rtts
]
rtts
=
[(
round
(
rtt
*
1000
))
for
r
in
results
for
rtt
in
r
.
rtts
]
rtt
=
round
(
median
(
rtts
))
rtt
=
round
(
median
(
rtts
))
if
rtts
else
None
return
rtt
return
rtt
@
staticmethod
@
staticmethod
...
...
sbws/util/config.py
View file @
e0532a96
...
@@ -236,7 +236,7 @@ def _validate_scanner(conf):
...
@@ -236,7 +236,7 @@ def _validate_scanner(conf):
sec
=
'scanner'
sec
=
'scanner'
err_tmpl
=
Template
(
'$sec/$key ($val): $e'
)
err_tmpl
=
Template
(
'$sec/$key ($val): $e'
)
ints
=
{
ints
=
{
'num_rtts'
:
{
'minimum'
:
1
,
'maximum'
:
100
},
'num_rtts'
:
{
'minimum'
:
0
,
'maximum'
:
100
},
'num_downloads'
:
{
'minimum'
:
1
,
'maximum'
:
100
},
'num_downloads'
:
{
'minimum'
:
1
,
'maximum'
:
100
},
'initial_read_request'
:
{
'minimum'
:
1
,
'maximum'
:
None
},
'initial_read_request'
:
{
'minimum'
:
1
,
'maximum'
:
None
},
'measurement_threads'
:
{
'minimum'
:
1
,
'maximum'
:
None
},
'measurement_threads'
:
{
'minimum'
:
1
,
'maximum'
:
None
},
...
...
Write
Preview
Markdown
is supported
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