apoorvmittal10 commented on code in PR #20152: URL: https://github.com/apache/kafka/pull/20152#discussion_r2200852049
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java: ########## @@ -1407,7 +1408,8 @@ public GroupCoordinatorMetrics(Metrics metrics, String metricGrpPrefix) { this.metricGrpName, "The number of successful rebalance events per hour, each event is composed of " + "several failed re-trials until it succeeded"), - new Rate(TimeUnit.HOURS, new WindowedCount()) + new Rate(TimeUnit.HOURS, new WindowedCount()), + new MetricConfig().timeWindow(1, TimeUnit.HOURS) Review Comment: Are there any down side of losing the original attributes set in metrics config like `recordLevel`, `number of samples` and `tags`? ########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java: ########## @@ -1407,7 +1408,8 @@ public GroupCoordinatorMetrics(Metrics metrics, String metricGrpPrefix) { this.metricGrpName, "The number of successful rebalance events per hour, each event is composed of " + "several failed re-trials until it succeeded"), - new Rate(TimeUnit.HOURS, new WindowedCount()) + new Rate(TimeUnit.HOURS, new WindowedCount()), + new MetricConfig().timeWindow(1, TimeUnit.HOURS) Review Comment: Rather than fixing by providing another config object, will it not be appropriate to fix the `windowSize` method in Rate by also considering the `timeUnit`, rather only looking at [config.timeWindowMs()](https://github.com/apache/kafka/blob/c058c134d232d9eb75b00dfd900c0662d99b2de7/clients/src/main/java/org/apache/kafka/common/metrics/stats/Rate.java#L90)? -- 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