Skip to content

Commit bd14669

Browse files
committed
Fix in cases for large batch sizes
1 parent 58d611e commit bd14669

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/performance/performance-primitives-common.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,9 @@ async function runProducer(producer, topic, batchSize, warmupMessages, totalMess
383383

384384
let messageCnt = totalMessageCnt;
385385
if (messageCnt === -1) {
386-
messageCnt = batchSize * 10000;
386+
if (batchSize > 20000)
387+
batchSize = 20000;
388+
messageCnt = Math.ceil(20000 / batchSize) * batchSize;
387389
}
388390
const messages = Array(messageCnt);
389391
for (let i = 0; i < messageCnt; i++) {

0 commit comments

Comments
 (0)