ShivsundarR commented on code in PR #22718:
URL: https://github.com/apache/kafka/pull/22718#discussion_r3505400342
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/metrics/KafkaConsumerMetrics.java:
##########
@@ -102,7 +102,8 @@ public void recordPollStart(long pollStartMs) {
public void recordPollEnd(long pollEndMs) {
long pollTimeMs = pollEndMs - pollStartMs;
- double pollIdleRatio = pollTimeMs * 1.0 / (pollTimeMs +
timeSinceLastPollMs);
+ long pollCycleTimeMs = pollTimeMs + timeSinceLastPollMs;
+ double pollIdleRatio = pollCycleTimeMs == 0 ? 0.0 : pollTimeMs * 1.0 /
pollCycleTimeMs;
Review Comment:
Thanks, I have updated it now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]