hudi-agent commented on code in PR #18761:
URL: https://github.com/apache/hudi/pull/18761#discussion_r3279683077
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/metrics/FlinkIndexBackendMetrics.java:
##########
@@ -63,6 +76,21 @@ public void registerMetrics() {
metricGroup.histogram("remoteIndexLookupLatency",
remoteIndexLookupLatency);
metricGroup.histogram("localLookupKeysNum", localLookupKeysNum);
metricGroup.histogram("remoteLookupKeysNum", remoteLookupKeysNum);
+ metricGroup.gauge(LOOKUP_CACHE_HIT_RATIO, (Gauge<Double>) () ->
lookupCacheHitRatio);
+ }
+
+ /**
+ * Updates the per-mini-batch cache hit-ratio gauge from the hit/miss counts
already
+ * fed into {@link #updateLocalLookupKeysCount(long)} and {@link
#updateRemoteLookupKeysCount(long)}.
+ * When the lookup observed no keys, the previous value is preserved so
dashboards
+ * don't oscillate back to zero on idle mini-batches.
+ */
+ public void updateLookupCacheHitRatio(long hitCount, long missCount) {
Review Comment:
🤖 nit: the Javadoc says "from the hit/miss counts already fed into
`updateLocalLookupKeysCount` and `updateRemoteLookupKeysCount`", which implies
this method reads from shared state populated by those calls — but it actually
uses its own `hitCount`/`missCount` parameters directly. Could you drop that
cross-reference and just describe what the two parameters represent?
<sub><i>- AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]