Yunyung commented on code in PR #20152:
URL: https://github.com/apache/kafka/pull/20152#discussion_r2202317949


##########
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:
   Sorry, looks like you replied just after I deleted my earlier comment. I’ve 
rethought the approach.
   
   The current patch feels more like a workaround.
   Instead, we should probably create a variable:
   `timeWindowMs = Math.max(unit.toMillis(1), config.timeWindowMs())` in `Rate` 
to determine window length, and then pass this `timeWindowMs` to SampledStat 
rather than using `config.timeWindowMs()` directly. Additionally, I think other 
`MeasurableStat` that use `config.timeWindowMs()` besides `Rate` might have the 
same issue.
   
   Let’s see if there is agreement or any other ideas.



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

Reply via email to