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



##########
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:
       It seems to me that the origin code want to count the elapsed time of 
joining group. Hence, the ```joinStart``` is required and the following 
```joinStart = System.currentTimeMillis``` is required too. 
   
   For another, the initial value of ```joinStart``` is incorrect. It should be 
equal to ```testStartTime```

##########
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:
       hmmm, is there a good place to update the  start time of join? 

##########
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:
       hmmm, is there a good place to update the  start time of join if they 
are NOT called just once?




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to