kevin-wu24 commented on code in PR #20422: URL: https://github.com/apache/kafka/pull/20422#discussion_r2307788763
########## metadata/src/main/java/org/apache/kafka/controller/metrics/QuorumControllerMetrics.java: ########## @@ -157,8 +164,22 @@ public Long value() { return newActiveControllers(); } })); + registry.ifPresent(r -> r.newGauge(AVERAGE_IDLE_RATIO, this.avgIdleTimeRatio)); Review Comment: Since `Gauge` is a functional interface, can we use the `TimeRatio` class directly in `QuorumControllerMetrics`? Then our gauge can be an anonymous class where `value()` returns `timeRatio.meausre()`. This removes the need for either `TimeRatio` wrapper class. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org