-
Notifications
You must be signed in to change notification settings - Fork 52
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): add close group shunned metrics #2167
feat(metrics): add close group shunned metrics #2167
Conversation
sn_networking/src/metrics/service.rs
Outdated
println!("Metrics server on http://{}/metrics", server.local_addr()); | ||
|
||
info!("Metrics server on http://{} Available endpoints: /metrics, /metrics_extended, /metadata", server.local_addr()); |
Check warning
Code scanning / devskim
An HTTP-based URL without TLS was detected. Warning
82a7a79
to
ddfd4c5
Compare
0b47ce7
to
3329dc8
Compare
3329dc8
to
f050a0e
Compare
self.metric_current_group.inc(); | ||
self.close_group_peers_that_have_shunned_us.insert(peer); | ||
self.old_new_group_shunned_list.insert(peer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be outside of the inner if clause but within the outer if clause
so that only one code line of insertion
will be enough.
of you can even do if self.old_new_group_shunned_list.insert(peer).is_none() { ... }
to avoid separated check then insert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be outside of the inner if clause but within the outer if clause
so that only one code line of insertion will be enough.
Do you mean within this clause? !self.old_new_group_shunned_list.contains(&peer)
But that would contain ALL peers that are observed by us. I only want the ones that are in the close group (either old / new).
/metrics_extended
endpoint based on the shunned_count:shunned_by_close_group
- The number of close group peers that have shunned our nodeshunned_by_old_close_group
- The number of close group peers that have shunned our node. This contains the peers that were once in our close group but have since been evicted.