Apoorv Mittal created KAFKA-19493:
-------------------------------------
Summary: Incorrect rate metric with larger window size
Key: KAFKA-19493
URL: https://issues.apache.org/jira/browse/KAFKA-19493
Project: Kafka
Issue Type: Bug
Reporter: Apoorv Mittal
The Kafka Rate metric gives incorrect rate when the window size is larger say
hourly.
I suspect the code for calculating rate is incorrect for metrics which are not
emitting rate per second or millisecond. The code for time unit calculation
seems wrong: [convert(windowSize(config, now),
unit)|https://github.com/apache/kafka/blob/da4fbba2793528e283458e080a690ad141857b0b/clients/src/main/java/org/apache/kafka/common/metrics/stats/Rate.java#L67]
i.e. the convert code divides the elapsed time in window to the time unit.
The problem can be easily reporduced by looking at `rebalance-rate-per-hour`
metric.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)