Skip to content

Commit 45c4097

Browse files
committed
Fixes
1 parent ebef2af commit 45c4097

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

ci/tests/run_perf_test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ function runCommand(command) {
99
return output;
1010
} catch (error) {
1111
const errorOutput = error.stdout || error.stderr || error.message;
12-
console.log(errorOutput);
12+
console.log(error.stdout);
13+
console.log(error.stderr);
14+
console.log(error.message);
1315
return errorOutput;
1416
}
1517
}
@@ -30,7 +32,7 @@ function extractValue(content, pattern) {
3032

3133
function belowThreshold(value, target, threshold = 0.7) {
3234
if (isNaN(value) || isNaN(target))
33-
throw new Error(`Invalid number comparison: value=${value}, target=${target}`);
35+
return false;
3436
return value < (target * threshold);
3537
}
3638

examples/performance/performance-primitives-common.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ async function runConsumer(consumer, topic, warmupMessages, totalMessageCnt, eac
5757

5858
if (!startTime) {
5959
startTime = hrtime.bigint();
60-
} else if (messagesMeasured === totalMessageCnt) {
60+
} else if (messagesMeasured >= totalMessageCnt) {
6161
let durationNanos = Number(hrtime.bigint() - startTime);
6262
durationSeconds = durationNanos / 1e9;
63-
rate = (totalMessageSize / durationNanos) * 1e9 / (1024 * 1024); /* MB/s */
63+
rate = durationNanos === 0 ? Infinity :
64+
(totalMessageSize / durationNanos) * 1e9 / (1024 * 1024); /* MB/s */
6465
console.log(`Recvd ${messagesMeasured} messages in ${durationSeconds} seconds, ${totalMessageSize} bytes; rate is ${rate} MB/s`);
6566
consumer.pause([{ topic }]);
6667
}

examples/performance/performance-primitives.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function baseConfiguration(parameters) {
2222
ret = {
2323
...ret,
2424
'security.protocol': parameters.securityProtocol,
25-
'sasl.mechanism': 'plain',
25+
'sasl.mechanism': 'PLAIN',
2626
'sasl.username': parameters.saslUsername,
2727
'sasl.password': parameters.saslPassword,
2828
};

0 commit comments

Comments
 (0)