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


##########
tools/src/main/java/org/apache/kafka/tools/ShareConsumerPerformance.java:
##########
@@ -75,11 +75,21 @@ static void run(String[] args, Function<Properties, 
ShareConsumer<byte[], byte[]
                 printHeader();
 
             List<ShareConsumer<byte[], byte[]>> shareConsumers = new 
ArrayList<>();
+            List<String> clientIds = new ArrayList<>();
             for (int i = 0; i < options.threads(); i++) {
-                
shareConsumers.add(shareConsumerCreator.apply(options.props()));
+                if (options.threads() == 1) {
+                    
clientIds.add(options.props().getProperty(ConsumerConfig.CLIENT_ID_CONFIG));
+                    
shareConsumers.add(shareConsumerCreator.apply(options.props()));
+                    continue;

Review Comment:
   Although both achieve the same behaviour in this specific case, perhaps 
`break` is the more suitable choice here



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