network:bridge: fix peer_count metric (#3711)
The metric records the current protocol_version of the validator that
just connected with the peer_map.len(), which contains all peers that
connected, that has the effect the metric will be wrong since it won't
tell us how many peers we have connected per version because it will
always record the total number of peers
Fix this by counting by version inside peer_map, additionally because
that might be a bit heavier than len(), publish it only on-active
leaves.
---------
Signed-off-by: Alexandru Gheorghe <[email protected]>
Please register or sign in to comment