Commit 6047da5c authored by juga  's avatar juga
Browse files

new: v3bwfile: Include relay consensus count

Include a KeyValue in each bandwidth line with the number of
times the relay has been in a consensus in the past days.

Part of #28566.
parent 1387f91c
......@@ -404,6 +404,11 @@ class V3BWLine(object):
kwargs['master_key_ed25519'] = results[0].master_key_ed25519
kwargs['time'] = cls.last_time_from_results(results)
kwargs.update(cls.result_types_from_results(results))
consensuses_count = [r.consensus_count for r in results
if getattr(r, 'consensus_count', None)]
if consensuses_count:
consensus_count = max(consensuses_count)
kwargs['relay_in_recent_consensus_count'] = consensus_count
success_results = [r for r in results if isinstance(r, ResultSuccess)]
if not success_results:
......
Markdown is supported
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