-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
query { | ||
active_peers:peers(where: {and: [{currentCapacityCommitment_:{status:Active}}, {provider_: {approved: true}}]}) { | ||
computeUnitsTotal | ||
}, | ||
peers_total:peers(where: {and: [{provider_: {approved: true}}]}) { | ||
computeUnitsTotal | ||
} | ||
} |
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.
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.
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) |
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.
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) |
No description provided.