hudi-agent commented on code in PR #18761:
URL: https://github.com/apache/hudi/pull/18761#discussion_r3279044819
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/metrics/FlinkIndexBackendMetrics.java:
##########
@@ -20,19 +20,23 @@
import com.codahale.metrics.SlidingWindowReservoir;
import org.apache.flink.dropwizard.metrics.DropwizardHistogramWrapper;
+import org.apache.flink.metrics.Gauge;
import org.apache.flink.metrics.Histogram;
import org.apache.flink.metrics.MetricGroup;
import org.apache.hudi.common.util.VisibleForTesting;
/**
* Metrics for the {@link
org.apache.hudi.sink.partitioner.index.GlobalRecordLevelIndexBackend}.
- * Tracks cache hit/miss counts and the latency of local (cache) vs. remote
(metadata table) lookups.
+ * Tracks the latency of local (cache) vs. remote (metadata table) lookups,
the per-lookup key
+ * counts, and the per-mini-batch in-memory cache hit ratio.
*/
public class FlinkIndexBackendMetrics extends HoodieFlinkMetrics {
private static final int HISTOGRAM_WINDOW_SIZE = 100;
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_RATIO =
"bucketassign.minibatch.cache.hit_ratio";
Review Comment:
🤖 nit: the value `"bucketassign.minibatch.cache.hit_ratio"` uses
dot-separated lowercase with an underscore, while every other metric registered
in this class uses flat camelCase (`"remoteIndexLookupLatency"`,
`"localLookupKeysNum"`, etc.). In Flink, dots in a metric name create sub-group
path segments, so this gauge would land in a different namespace than the
histograms — likely surprising on a dashboard. Could you align it to something
like `"minibatchCacheHitRatio"` or `"bucketAssignMinibatchCacheHitRatio"`?
<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]