Commit 52e64583 authored by juga's avatar 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
......@@ -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,
)
......@@ -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),
)
)
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment