[ 
https://issues.apache.org/jira/browse/KAFKA-19493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18004473#comment-18004473
 ] 

Apoorv Mittal commented on KAFKA-19493:
---------------------------------------

[~isding_l] Please go ahead.

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

Reply via email to