hudi-agent commented on code in PR #18761:
URL: https://github.com/apache/hudi/pull/18761#discussion_r3272514016
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/metrics/FlinkIndexBackendMetrics.java:
##########
@@ -33,6 +35,9 @@ public class FlinkIndexBackendMetrics extends
HoodieFlinkMetrics {
private static final String LOCAL_INDEX_LOOKUP_KEY = "local_index_lookup";
private static final String REMOTE_INDEX_LOOKUP_KEY = "remote_index_lookup";
+ public static final String BUCKET_ASSIGN_MINIBATCH_CACHE_HIT_COUNT =
"bucketassign.minibatch.cache.hit.count";
Review Comment:
🤖 nit: the metric name values use dot-separated format
(`"bucketassign.minibatch.cache.hit.count"`) while the other metrics registered
in this class use camelCase (`"remoteIndexLookupLatency"`,
`"localLookupKeysNum"`, etc.). Could you align them — e.g.
`"bucketAssignMinibatchCacheHitCount"` /
`"bucketAssignMinibatchCacheMissCount"`?
<sub><i>- AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/metrics/FlinkIndexBackendMetrics.java:
##########
@@ -63,6 +76,22 @@ public void registerMetrics() {
metricGroup.histogram("remoteIndexLookupLatency",
remoteIndexLookupLatency);
metricGroup.histogram("localLookupKeysNum", localLookupKeysNum);
metricGroup.histogram("remoteLookupKeysNum", remoteLookupKeysNum);
+ metricGroup.counter(BUCKET_ASSIGN_MINIBATCH_CACHE_HIT_COUNT,
cacheHitCount);
+ metricGroup.counter(BUCKET_ASSIGN_MINIBATCH_CACHE_MISS_COUNT,
cacheMissCount);
+ }
+
+ public void markCacheHit(long n) {
+ if (n <= 0) {
Review Comment:
🤖 nit: the parameter `n` is a bit opaque for a public method — could you
rename it to `count` in both `markCacheHit` and `markCacheMiss`? Callers
reading `metrics.markCacheHit(hitCount)` will see the argument, but the method
signature itself is easier to reason about with `count`.
<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]