arshilkxwork commented on code in PR #3357:
URL: https://github.com/apache/hugegraph/pull/3357#discussion_r4291678027
##########
hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/metrics/PDMetrics.java:
##########
@@ -111,6 +117,8 @@ private long updateGraphs() {
}
private long updateStores() {
+ // Registers the per-store gauges of stores that joined since the last
scrape
+ this.storeStateMetrics.refreshIfStale();
Review Comment:
Done in 1ae51c92d. `hg.stores` now reads `StoreStateMetrics.storeCount()`,
which runs the due refresh and returns the size of the list that refresh read,
so a scrape scans the store prefix once. The old `getStores()` helper in
`PDMetrics` is gone.
One side effect: on a failed read `hg_stores` keeps its last value, like the
per-store gauges, where it used to report `0`.
`testPrometheusScrape` now counts reads: two scrapes in one refresh interval
read the store list once and print `hg_stores 1.0`. `hg-pd-service` tests: 21,
0 failures.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]