Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(metrics): expose connected_peers, peers_in_rt and uptime metrics #1896

Merged
merged 6 commits into from
Jun 18, 2024

Conversation

RolandSherwin
Copy link
Member

@RolandSherwin RolandSherwin commented Jun 17, 2024

  • Exposes 4 metrics: peers_in_rt, connected_peers, live_connections and uptime
  • The uptime is updated every 10 secs from the main node loop.

@@ -589,7 +589,7 @@ impl NetworkBuilder {
listen_port: self.listen_addr.map(|addr| addr.port()),
is_client,
is_behind_home_network: self.is_behind_home_network,
connected_peers: 0,
peers_in_rt: 0,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tracks the total number of peers in the RT rather than the "connections". So renamed it for clarity.

info!("Evicted old peer on new peer join: {old_peer:?}");
self.send_event(NetworkEvent::PeerRemoved(peer, self.connected_peers));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were supposed to emit PeerRemoved(old_peer) instead of peer here.

@RolandSherwin RolandSherwin force-pushed the move_metrics_from_rpc branch from 8b2b3c4 to 1d993a7 Compare June 17, 2024 04:13
@joshuef joshuef added this pull request to the merge queue Jun 18, 2024
Merged via the queue into maidsafe:main with commit f083fb7 Jun 18, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants