chia7712 commented on code in PR #24118:
URL: https://github.com/apache/kafka/pull/24118#discussion_r4494308366


##########
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java:
##########
@@ -114,16 +111,14 @@ protected static void printHeader(boolean 
showDetailedStats) {
             System.out.printf("time, threadId, data.consumed.in.MB, MB.sec, 
data.consumed.in.nMsg, nMsg.sec%s%n", newFieldsInHeader);
     }
 
-    private static void consume(Consumer<byte[], byte[]> consumer,
-                                ConsumerPerfOptions options,
-                                AtomicLong totalRecordsRead,
-                                AtomicLong totalBytesRead,
-                                AtomicLong joinTimeMs,
-                                long startMs) {
+    private static ConsumeStats consume(Consumer<byte[], byte[]> consumer,
+                                        ConsumerPerfOptions options,
+                                        long startMs) {
         long bytesRead = 0L;
         long recordsRead = 0L;
         long lastBytesRead = 0L;
         long lastRecordsRead = 0L;
+        AtomicLong joinTimeMs = new AtomicLong(0);

Review Comment:
   The type `AtomicLong` is used to allow `ConsumerPerfRebListener` to write 
the value back. However, we could let `ConsumerPerfRebListener` have its own 
field and expose the value. This can be addressed in a follow-up.



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

Reply via email to