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
52e64583
Commit
52e64583
authored
May 16, 2022
by
juga
Browse files
chg: Consensus weight fraction of CC exits
Closes #40139
parent
9547c835
Pipeline
#38800
failed with stages
in 9 minutes and 8 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
sbws/core/flowctrl2.py
View file @
52e64583
...
...
@@ -164,3 +164,28 @@ def main(args, conf):
" double or same bandwidth: %s."
,
non_exits_without_helpers_flowctrl2_same_double_bw
,
)
sum_consensus_bw
=
rl
.
sum_consensus_bw
log
.
info
(
"Total consensus weight: %s"
,
sum_consensus_bw
/
1000
)
sum_consensus_bw_exits_not_bad_allowing_port
=
(
rl
.
sum_consensus_bw_exits_not_bad_allowing_port
)
log
.
info
(
"Consensus weight of exits (without BAD flag, allowing 443 port): %s"
,
sum_consensus_bw_exits_not_bad_allowing_port
/
1000
,
)
sum_consensus_bw_exits_flowctrl2
=
rl
.
sum_consensus_bw_exits_flowctrl2
log
.
info
(
"Cnsensus weight exits (without BAD flag, allowing 443 port)"
" with 2 in FlowCtrl: %s"
,
sum_consensus_bw_exits_flowctrl2
,
)
fraction_flowctrl2_exits
=
(
sum_consensus_bw_exits_flowctrl2
/
sum_consensus_bw_exits_not_bad_allowing_port
)
log
.
info
(
"Fraction of consensus weight of exits with 2 in FlowCtrl with respect"
" all the exits: %.2f"
,
fraction_flowctrl2_exits
,
)
sbws/lib/relaylist.py
View file @
52e64583
...
...
@@ -672,3 +672,36 @@ class RelayList:
def
non_exit_min_bw
(
self
):
return
self
.
_non_exit_min_bw
@
property
def
sum_consensus_bw
(
self
):
return
sum
(
list
(
map
(
lambda
r
:
r
.
consensus_bandwidth
,
self
.
relays
,
)
)
)
@
property
def
sum_consensus_bw_exits_not_bad_allowing_port
(
self
):
return
sum
(
list
(
map
(
lambda
r
:
r
.
consensus_bandwidth
,
self
.
exits_not_bad_allowing_port
(
443
),
)
)
)
@
property
def
sum_consensus_bw_exits_flowctrl2
(
self
):
return
sum
(
list
(
map
(
lambda
r
:
r
.
consensus_bandwidth
,
self
.
exits_with_2_in_flowctrl
(
443
),
)
)
)
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