Skip to content

Commit 504761b

Browse files
authoredDec 12, 2024
fix(tools/perf): fix the perf tools await count (#2220)
Signed-off-by: Robin Han <[email protected]>

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎tools/src/main/java/org/apache/kafka/tools/automq/PerfCommand.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,12 @@ private void waitTopicsReady(boolean hasConsumer) {
179179
private void waitTopicsReadyWithConsumer() {
180180
long start = System.nanoTime();
181181
boolean ready = false;
182+
int expectPartitionCount = config.topics * config.partitionsPerTopic;
182183
while (System.nanoTime() < start + TOPIC_READY_TIMEOUT_NANOS) {
183-
int sent = producerService.probe();
184+
producerService.probe();
184185
int received = readyPartitions.size();
185-
LOGGER.info("Waiting for topics to be ready... sent: {}, received: {}", sent, received);
186-
if (received >= sent) {
186+
LOGGER.info("Waiting for topics to be ready... sent: {}, received: {}", expectPartitionCount, received);
187+
if (received >= expectPartitionCount) {
187188
ready = true;
188189
break;
189190
}

0 commit comments

Comments
 (0)
Please sign in to comment.