Skip to content

Commit b888bfe

Browse files
committed
benchmark: allow zero when parsing http req/s
Without this, the http benchmarker would report "strange output" if wrk or any other http client reported 0 requests per second, which is a valid result. PR-URL: #10558 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]>
1 parent 176cdc2 commit b888bfe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

benchmark/_http-benchmarkers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ WrkBenchmarker.prototype.create = function(options) {
6161
WrkBenchmarker.prototype.processResults = function(output) {
6262
const match = output.match(this.regexp);
6363
const result = match && +match[1];
64-
if (!result) {
64+
if (!isFinite(result)) {
6565
return undefined;
6666
} else {
6767
return result;
@@ -126,7 +126,7 @@ exports.run = function(options, callback) {
126126
}
127127

128128
const result = benchmarker.processResults(stdout);
129-
if (!result) {
129+
if (result === undefined) {
130130
callback(new Error(`${options.benchmarker} produced strange output: ` +
131131
stdout, code));
132132
return;

0 commit comments

Comments
 (0)