MahsaSeifikar commented on code in PR #20422: URL: https://github.com/apache/kafka/pull/20422#discussion_r2307835951
########## 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: Thanks Kevin for the suggestion! We definitly can use an anonymous class, but this pattern needed because it enables us to share the same `TimeRatio` implementation for both Yammer Metrics and Kafka Metrics which provides a clear architectural separation with minimal overhead. it also allows for potential reuse of `TimeRatio` with Yammer Metrics in the future cases. -- 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