jsancio commented on code in PR #20724:
URL: https://github.com/apache/kafka/pull/20724#discussion_r2465803270


##########
metadata/src/test/java/org/apache/kafka/image/loader/metrics/MetadataLoaderMetricsTest.java:
##########
@@ -256,6 +265,28 @@ public void testFinalizedFeatureLevelMetrics() {
             registry.shutdown();
         }
     }
+    @Test
+    public void testAvgIdleRatio() {
+        final double delta = 0.001;
+        MetricsRegistry registry = new MetricsRegistry();
+        try (FakeMetadataLoaderMetrics fakeMetrics = new 
FakeMetadataLoaderMetrics(registry)) {
+            @SuppressWarnings("unchecked")
+            Gauge<Double> avgIdleRatio = (Gauge<Double>) 
registry.allMetrics().get(metricName("MetadataLoader", "AvgIdleRatio"));
+
+            assertEquals(1.0, avgIdleRatio.value(), delta);
+
+            fakeMetrics.metrics.updateIdleTime(10);

Review Comment:
   Please document that this update idle time is ignored by the TimeRatio 
sensor.



##########
metadata/src/main/java/org/apache/kafka/image/loader/MetadataLoader.java:
##########
@@ -217,10 +218,11 @@ private MetadataLoader(
             faultHandler,
             this::maybePublishMetadata);
         this.eventQueue = new KafkaEventQueue(
-            Time.SYSTEM,
+            time,

Review Comment:
   Thanks for fixing this.



-- 
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]

Reply via email to