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
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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: