improvement of relay related metrics; remove relay clients if we have no more connections #2767
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SwarmDriver::connected_relay_clients
tracker if theReservation
has been closed. This happens when all the connection with the relay client has been lost. Libp2p does not have an event for this yet, so we have to do a manual check for this.peers_in_rt
value directly from the kbuckets instead of acting upon the libp2p events. The latter gave incorrect values, and it is very prone to errors, as everyone should be careful to call theupdate
fn everytime we manually remove a peer from the RT.connected_relay_clients
metric.relay_peers_in_routing_table
,peers_in_non_full_buckets
,relay_peers_in_non_full_buckets
andpercentage_of_relay_peers
metrics.