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

Add peer connection metrics by peer purpose #1127

Merged
merged 5 commits into from
Aug 6, 2020
Merged

Conversation

mcortesi
Copy link
Contributor

@mcortesi mcortesi commented Aug 4, 2020

Description

Add number of active (connected) peers metrics discriminated by purpose (validator & proxy).

With this, we should be able to monitor how many validator or proxy connection a node currently has.

Other changes

Refactors PurposeFlag use:

  • Make it immutable, thus easier to track
  • Use Add , Remove vs Set(bool)
  • Peer now has a single purpose which is the combination of
    trustedPurposes & staticPurposes

Tested

CI, manual

Related issues

  • Fixes #[issue number here]

Backwards compatibility

Brief explanation of why these changes are/are not backwards compatible.

* Make it immutable, thus easier to track
* Use `Add` , `Remove` vs `Set(bool)`
* Peer now has a single purpose which is the combination of
trustedPurposes & staticPurposes
@mcortesi mcortesi requested a review from kevjue as a code owner August 4, 2020 16:29
@mcortesi mcortesi marked this pull request as draft August 4, 2020 16:29
@mcortesi mcortesi marked this pull request as ready for review August 4, 2020 16:45
Copy link
Contributor

@tkporter tkporter left a comment

Choose a reason for hiding this comment

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

Some nits, lgtm otherwise

p2p/peer.go Outdated Show resolved Hide resolved
p2p/peer.go Outdated Show resolved Hide resolved
p2p/peer.go Outdated Show resolved Hide resolved
@mcortesi mcortesi merged commit 63f071a into master Aug 6, 2020
@mcortesi mcortesi deleted the mc/peer-metrics branch August 6, 2020 16:13
@mcortesi mcortesi added this to the 1.0.2 milestone Sep 24, 2020
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