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: Add metric for active peers #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

feat: Add metric for active peers #33

wants to merge 2 commits into from

Conversation

DieMyst
Copy link
Member

@DieMyst DieMyst commented Nov 7, 2024

No description provided.

@DieMyst DieMyst requested a review from folex November 7, 2024 07:45
@DieMyst DieMyst closed this Nov 7, 2024
@DieMyst DieMyst reopened this Nov 7, 2024
@DieMyst DieMyst marked this pull request as draft November 7, 2024 08:07
@DieMyst DieMyst marked this pull request as ready for review November 7, 2024 08:32
Comment on lines +318 to +325
query {
active_peers:peers(where: {and: [{currentCapacityCommitment_:{status:Active}}, {provider_: {approved: true}}]}) {
computeUnitsTotal
},
peers_total:peers(where: {and: [{provider_: {approved: true}}]}) {
computeUnitsTotal
}
}
Copy link
Member

Choose a reason for hiding this comment

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

You probably can do just one peers(), and ask for CC status instead of computeUnitsTotal.

Then you can count Active in Python. This way, it would be less load on the Indexer, and less data over the wire.

Comment on lines +50 to +51
ACTIVE_PEERS = Gauge("fluence_active_peers_count", "Total count of peers in active CCs", registry=registry)
PEERS_TOTAL = Gauge("fluence_peers_total_count", "Total count of peers", registry=registry)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ACTIVE_PEERS = Gauge("fluence_active_peers_count", "Total count of peers in active CCs", registry=registry)
PEERS_TOTAL = Gauge("fluence_peers_total_count", "Total count of peers", registry=registry)
ACTIVE_PEERS = Gauge("fluence_active_peer_count", "Total count of peers in active CCs", registry=registry)
PEERS_TOTAL = Gauge("fluence_total_peer_count", "Total count of peers", registry=registry)

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