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
1bdcb55c
Commit
1bdcb55c
authored
Apr 16, 2018
by
Matt Traudt
Committed by
Matt Traudt
Apr 16, 2018
Browse files
Superficial log format changes
parent
ac98dbce
Changes
5
Hide whitespace changes
Inline
Side-by-side
sbws/core/client.py
View file @
1bdcb55c
...
...
@@ -275,8 +275,8 @@ def _should_keep_result(did_request_maximum, result_time, download_times):
return
True
# In all other cases, return false
log
.
debug
(
'Not keeping result time %f.%s'
,
result_time
,
''
if
not
did_request_maximum
else
'We requested the maximum '
'amount allowed'
)
''
if
not
did_request_maximum
else
'
We requested the maximum '
'amount allowed
.
'
)
return
False
...
...
sbws/core/generate.py
View file @
1bdcb55c
...
...
@@ -48,8 +48,8 @@ def warn_if_not_accurate_enough(lines, constant):
log
.
info
(
'The generated lines are within {:.5}% of what they should '
'be'
.
format
((
1
-
accuracy_ratio
)
*
100
))
if
accuracy_ratio
<
1
-
margin
or
accuracy_ratio
>
1
+
margin
:
log
.
warning
(
'There was
{:.3f}
% error and only +/-
{:.3f}
% is '
'allowed'
.
format
(
(
1
-
accuracy_ratio
)
*
100
,
margin
*
100
,
2
)
)
log
.
warning
(
'There was
%f%
% error and only +/-
%f%
% is '
'allowed'
,
(
1
-
accuracy_ratio
)
*
100
,
margin
*
100
)
def
scale_lines
(
args
,
v3bw_lines
):
...
...
sbws/core/server.py
View file @
1bdcb55c
...
...
@@ -138,10 +138,9 @@ def main(args, conf):
if
len
(
conf
[
'server.passwords'
])
<
1
:
conf_fname
=
os
.
path
.
join
(
args
.
directory
,
'config.ini'
)
fail_hard
(
'Sbws server needs at least one password in the section'
' [server.passwords] in the config file in {}. See '
'DEPLOY.rst for more information.'
.
format
(
conf_fname
))
fail_hard
(
'Sbws server needs at least one password in the section '
'[server.passwords] in the config file in %s. See '
'DEPLOY.rst for more information.'
,
conf_fname
)
h
=
(
conf
[
'server'
][
'bind_ip'
],
conf
.
getint
(
'server'
,
'bind_port'
))
log
.
info
(
'Binding to %s:%d'
,
*
h
)
...
...
sbws/lib/relayprioritizer.py
View file @
1bdcb55c
...
...
@@ -96,12 +96,11 @@ class RelayPrioritizer:
cutoff
=
max
(
int
(
len
(
relays
)
*
PERCENT_TO_RETURN
),
MIN_TO_RETURN
)
fn_tstop
=
Decimal
(
time_now
())
fn_tdelta
=
(
fn_tstop
-
fn_tstart
)
*
1000
log
.
info
(
'Spent {0:.3f} msecs calculating relay best priority'
.
format
(
fn_tdelta
))
log
.
info
(
'Spent %f msecs calculating relay best priority'
,
fn_tdelta
)
# Finally, slowly return the relays to the caller (after removing the
# priority member we polluted the variable with ...)
for
relay
in
relays
[
0
:
cutoff
]:
log
.
debug
(
'Returning next relay %s with priority %f'
,
relay
.
nickname
,
round
(
relay
.
priority
,
2
)
)
relay
.
nickname
,
relay
.
priority
)
del
(
relay
.
priority
)
yield
relay
sbws/lib/resultdump.py
View file @
1bdcb55c
...
...
@@ -397,7 +397,7 @@ class ResultDump:
nick
=
result
.
nickname
self
.
store_result
(
result
)
write_result_to_datadir
(
result
,
self
.
datadir
)
log
.
debug
(
'
%s %s finished measurement'
,
fp
,
nick
)
log
.
debug
(
'%s %s finished measurement'
,
fp
,
nick
)
def
results_for_relay
(
self
,
relay
):
assert
isinstance
(
relay
,
RouterStatusEntryV3
)
...
...
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