Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

feat: Add metric for active peers#33

Open
DieMyst wants to merge 2 commits into
mainfrom
active_peers
Open

feat: Add metric for active peers#33
DieMyst wants to merge 2 commits into
mainfrom
active_peers

Conversation

@DieMyst

@DieMyst DieMyst commented Nov 7, 2024

Copy link
Copy Markdown
Contributor

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 thread graph_node_metrics.py
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
Copy Markdown
Contributor

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 thread metrics.py
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
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants