@@ -42,8 +42,11 @@ function belowTarget(value, target) {
4242async function main ( ) {
4343 // Run performance tests and store outputs in memory
4444 const messageCount = process . env . MESSAGE_COUNT ? + process . env . MESSAGE_COUNT : 50000 ;
45- const skipCtpTest = process . env . SKIP_CTP_TEST ? process . env . SKIP_CTP_TEST === 'true' : false ;
45+ let skipCtpTest = process . env . SKIP_CTP_TEST ? process . env . SKIP_CTP_TEST === 'true' : false ;
4646 const concurrentRun = process . env . CONCURRENT_RUN ? process . env . CONCURRENT_RUN === 'true' : false ;
47+ if ( concurrentRun ) {
48+ skipCtpTest = true ;
49+ }
4750 const consumerMode = process . env . CONSUMER_MODE || 'all' ;
4851 const produceToSecondTopic = process . env . PRODUCE_TO_SECOND_TOPIC ? process . env . PRODUCE_TO_SECOND_TOPIC === 'true' : false ;
4952 const produceToSecondTopicParam = produceToSecondTopic ? '--produce-to-second-topic' : '' ;
@@ -119,11 +122,11 @@ async function main() {
119122
120123 console . log ( 'Running Confluent CTP test...' ) ;
121124 const outputConfluentCtp = skipCtpTest ? '' :
122- runCommand ( 'MODE=confluent MESSAGE_COUNT=5000 node performance-consolidated.js --create-topics --ctp' ) ;
125+ ( await runCommand ( 'MODE=confluent MESSAGE_COUNT=5000 node performance-consolidated.js --create-topics --ctp' ) ) ;
123126
124127 console . log ( 'Running KafkaJS CTP test...' ) ;
125128 const outputKjsCtp = skipCtpTest ? '' :
126- runCommand ( 'MODE=kafkajs MESSAGE_COUNT=5000 node performance-consolidated.js --create-topics --ctp' ) ;
129+ ( await runCommand ( 'MODE=kafkajs MESSAGE_COUNT=5000 node performance-consolidated.js --create-topics --ctp' ) ) ;
127130
128131 // Extract Confluent results
129132 let ctpConfluent , ctpKjs ;
@@ -278,9 +281,11 @@ async function main() {
278281 console . log ( `Consumption time (eachMessage): confluent ${ consumerConfluentTime } , kafkajs ${ consumerKjsTime } ` ) ;
279282 console . log ( `Average RSS (eachMessage): confluent ${ consumerConfluentMessageAverageRSS } , kafkajs ${ consumerKjsMessageAverageRSS } ` ) ;
280283 console . log ( `Max RSS (eachMessage): confluent ${ consumerConfluentMessageMaxRSS } , kafkajs ${ consumerKjsMessageMaxRSS } ` ) ;
281- console . log ( `Average broker lag (eachMessage): confluent ${ consumerConfluentMessageAverageBrokerLag } , kafkajs ${ consumerKjsMessageAverageBrokerLag } ` ) ;
282- console . log ( `Max broker lag (eachMessage): confluent ${ consumerConfluentMessageMaxBrokerLag } , kafkajs ${ consumerKjsMessageMaxBrokerLag } ` ) ;
283- console . log ( `Sample size for broker lag measurement (eachMessage): confluent ${ consumerConfluentMessageTotalLagMeasurements } , kafkajs ${ consumerKjsMessageTotalLagMeasurements } ` ) ;
284+ if ( concurrentRun ) {
285+ console . log ( `Average broker lag (eachMessage): confluent ${ consumerConfluentMessageAverageBrokerLag } , kafkajs ${ consumerKjsMessageAverageBrokerLag } ` ) ;
286+ console . log ( `Max broker lag (eachMessage): confluent ${ consumerConfluentMessageMaxBrokerLag } , kafkajs ${ consumerKjsMessageMaxBrokerLag } ` ) ;
287+ console . log ( `Sample size for broker lag measurement (eachMessage): confluent ${ consumerConfluentMessageTotalLagMeasurements } , kafkajs ${ consumerKjsMessageTotalLagMeasurements } ` ) ;
288+ }
284289 }
285290 if ( consumerModeAll || consumerModeEachBatch ) {
286291 console . log ( `Consumer rates MB/s (eachBatch): confluent ${ consumerConfluentBatch } , kafkajs ${ consumerKjsBatch } ` ) ;
@@ -297,9 +302,11 @@ async function main() {
297302 console . log ( `Average eachBatch size: confluent ${ consumerConfluentBatchAverageSize } , kafkajs ${ consumerKjsBatchAverageSize } ` ) ;
298303 console . log ( `Average RSS (eachBatch): confluent ${ consumerConfluentBatchAverageRSS } , kafkajs ${ consumerKjsBatchAverageRSS } ` ) ;
299304 console . log ( `Max RSS (eachBatch): confluent ${ consumerConfluentBatchMaxRSS } , kafkajs ${ consumerKjsBatchMaxRSS } ` ) ;
300- console . log ( `Average broker lag (eachBatch): confluent ${ consumerConfluentBatchAverageBrokerLag } , kafkajs ${ consumerKjsBatchAverageBrokerLag } ` ) ;
301- console . log ( `Max broker lag (eachBatch): confluent ${ consumerConfluentBatchMaxBrokerLag } , kafkajs ${ consumerKjsBatchMaxBrokerLag } ` ) ;
302- console . log ( `Sample size for broker lag measurement (eachBatch): confluent ${ consumerConfluentBatchTotalLagMeasurements } , kafkajs ${ consumerKjsBatchTotalLagMeasurements } ` ) ;
305+ if ( concurrentRun ) {
306+ console . log ( `Average broker lag (eachBatch): confluent ${ consumerConfluentBatchAverageBrokerLag } , kafkajs ${ consumerKjsBatchAverageBrokerLag } ` ) ;
307+ console . log ( `Max broker lag (eachBatch): confluent ${ consumerConfluentBatchMaxBrokerLag } , kafkajs ${ consumerKjsBatchMaxBrokerLag } ` ) ;
308+ console . log ( `Sample size for broker lag measurement (eachBatch): confluent ${ consumerConfluentBatchTotalLagMeasurements } , kafkajs ${ consumerKjsBatchTotalLagMeasurements } ` ) ;
309+ }
303310 }
304311 if ( ! concurrentRun ) {
305312 console . log ( `Average RSS: confluent ${ consumerConfluentAverageRSS } , kafkajs ${ consumerKjsAverageRSS } ` ) ;
0 commit comments