You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/06/10 17:04:25 UTC

[GitHub] [kafka] guozhangwang commented on a change in pull request #8836: KAFKA-10124:Wrong rebalance.time.ms

guozhangwang commented on a change in pull request #8836:
URL: https://github.com/apache/kafka/pull/8836#discussion_r438277970



##########
File path: core/src/main/scala/kafka/tools/ConsumerPerformance.scala
##########
@@ -105,16 +105,14 @@ object ConsumerPerformance extends LazyLogging {
     var messagesRead = 0L
     var lastBytesRead = 0L
     var lastMessagesRead = 0L
-    var joinStart = 0L
     var joinTimeMsInSingleRound = 0L
 
     consumer.subscribe(topics.asJava, new ConsumerRebalanceListener {
       def onPartitionsAssigned(partitions: util.Collection[TopicPartition]): Unit = {
-        joinTime.addAndGet(System.currentTimeMillis - joinStart)

Review comment:
       In the new code we may not trigger `onPartitionsRevoked` anymore although `onPartitionsAssigned` is always triggered, so we can no longer rely on them to measure the latency. I'm actually thinking we can just get the rebalance latency from metrics directly --- KafkaConsumer.metrics() exposed them --- you can find more details of the added metrics in KIP-429.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org