You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Matthias J. Sax (Jira)" <ji...@apache.org> on 2025/07/10 15:36:00 UTC
[jira] [Updated] (KAFKA-19493) Incorrect rate metric with larger window size
[ https://issues.apache.org/jira/browse/KAFKA-19493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matthias J. Sax updated KAFKA-19493:
------------------------------------
Component/s: clients
metrics
> Incorrect rate metric with larger window size
> ---------------------------------------------
>
> Key: KAFKA-19493
> URL: https://issues.apache.org/jira/browse/KAFKA-19493
> Project: Kafka
> Issue Type: Bug
> Components: clients, metrics
> Reporter: Apoorv Mittal
> Priority: Major
>
> 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)