[ https://issues.apache.org/jira/browse/KAFKA-3111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15105951#comment-15105951 ]
ASF GitHub Bot commented on KAFKA-3111: --------------------------------------- GitHub user vahidhashemian reopened a pull request: https://github.com/apache/kafka/pull/788 KAFKA-3111: Fix ConsumerPerformance output for zero interval lengths Interval lengths for ConsumerPerformance could sometime be calculated as zero. In such cases, when the bytes read or messages read are also zero a NaN output is returned for mbRead per second or for nMsg per second, whereas zero would be a more appropriate output. In cases where interval length is zero but there have been data and messages to read, an output of Infinity is returned, as expected. You can merge this pull request into a Git repository by running: $ git pull https://github.com/vahidhashemian/kafka KAFKA-3111 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/788.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #788 ---- commit 34c54e98c5e641986d74506edfd17b0c0ba105c2 Author: Vahid Hashemian <vahidhashem...@us.ibm.com> Date: 2016-01-18T21:50:02Z KAFKA-3111: Fix ConsumerPerformance output for zero interval lengths ---- > java.lang.ArithmeticException: / by zero in ConsumerPerformance > --------------------------------------------------------------- > > Key: KAFKA-3111 > URL: https://issues.apache.org/jira/browse/KAFKA-3111 > Project: Kafka > Issue Type: Bug > Components: core > Affects Versions: 0.9.0.0 > Reporter: Jun Rao > Assignee: Vahid Hashemian > Labels: newbie > > Saw the following error. If there are lots of unconsumed messages, between > two iterations of the consumption, the timestamp may not have changed. > kafka-consumer-perf-test --zookeeper localhost:2181 --topic test --group > test-group --threads 1 --show-detailed-stats --reporting-interval 5000 > 2016-01-13 09:12:43:905, 0, 1048576, 35.2856, 238.4186, 370000, 2500000.0000 > 2016-01-13 09:12:43:916, 0, 1048576, 35.7624, 47.6837, 375000, 500000.0000 > java.lang.ArithmeticException: / by zero > at > kafka.tools.ConsumerPerformance$ConsumerPerfThread.printMessage(ConsumerPerformance.scala:189) > at > kafka.tools.ConsumerPerformance$ConsumerPerfThread.run(ConsumerPerformance.scala:164) > 2016-01-13 09:12:43:918, 0, 1048576, 36.2393, 0.7117, 380000, 7000.0000 -- This message was sent by Atlassian JIRA (v6.3.4#6332)