[ 
https://issues.apache.org/jira/browse/KAFKA-13911?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jose Armando Garcia Sancio resolved KAFKA-13911.
------------------------------------------------
      Reviewer: Ismael Juma
    Resolution: Fixed

Closing as it was merged to trunk and 3.3.

> Rate is calculated as NaN for minimum config values
> ---------------------------------------------------
>
>                 Key: KAFKA-13911
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13911
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Divij Vaidya
>            Assignee: Divij Vaidya
>            Priority: Minor
>             Fix For: 3.3.0
>
>
> Implementation of connection creation rate quotas in Kafka is dependent on 
> two configurations:
>  # 
> [quota.window.num|https://kafka.apache.org/documentation.html#brokerconfigs_quota.window.num]
>  # 
> [quota.window.size.seconds|https://kafka.apache.org/documentation.html#brokerconfigs_quota.window.size.seconds]
> The minimum possible values of these configuration is 1 as per the 
> documentation. However, 1 as a minimum value for quota.window.num is invalid 
> and leads to failure for calculation of rate as demonstrated below.
> As a proof of the bug, the following unit test fails:
> {code:java}
> @Test
> public void testUseWithMinimumPossibleConfiguration() {
>     final Rate r = new Rate();
>     MetricConfig config = new MetricConfig().samples(1).timeWindow(1, 
> TimeUnit.SECONDS);
>     Time elapsed = new MockTime();
>     r.record(config, 1.0, elapsed.milliseconds());
>     elapsed.sleep(100);
>     r.record(config, 1.0, elapsed.milliseconds());
>     elapsed.sleep(1000);
>     final Double observedRate = r.measure(config, elapsed.milliseconds());
>     assertFalse(Double.isNaN(observedRate));
> } {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to