Skip to content

Commit

Permalink
fix(tools/perf): fix the perf tools await count (#2219)
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Han <[email protected]>
  • Loading branch information
superhx authored Dec 12, 2024
1 parent 1666892 commit 0265f44
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,12 @@ private void waitTopicsReady(boolean hasConsumer) {
private void waitTopicsReadyWithConsumer() {
long start = System.nanoTime();
boolean ready = false;
int expectPartitionCount = config.topics * config.partitionsPerTopic;
while (System.nanoTime() < start + TOPIC_READY_TIMEOUT_NANOS) {
int sent = producerService.probe();
producerService.probe();
int received = readyPartitions.size();
LOGGER.info("Waiting for topics to be ready... sent: {}, received: {}", sent, received);
if (received >= sent) {
LOGGER.info("Waiting for topics to be ready... sent: {}, received: {}", expectPartitionCount, received);
if (received >= expectPartitionCount) {
ready = true;
break;
}
Expand Down

0 comments on commit 0265f44

Please sign in to comment.