DL1231 commented on PR #20152: URL: https://github.com/apache/kafka/pull/20152#issuecomment-3135518036
> Thanks for the update. If the unit represents a larger time span than windowSizeMs, we always need to handle this case; otherwise the computed value will be incorrect. Shouldn’t we update the internal logic of Rate directly instead of relying on developers/user to know that they need to pass a new MetricConfig? Furthermore, this issue isn’t limited to `Rate`. Hmm... I feel that modifying the logic of `timeWindowMs` within `Rate` seems odd. In the current monitoring framework, the collection and calculation of all metrics rely on `MetricConfig.timeWindowMs()`. If we make the change as suggested above, this principle would be broken. Perhaps we could check the relationship between the `Rate.unit` and `MetricConfig.timeWindowMs()` when registering the metric to the sensor. If the latter is smaller, we should throw an exception. WDYT? -- 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