mirror of https://github.com/nodejs/node.git
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: https://github.com/nodejs/node/pull/10558 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>pull/10558/head
parent
176cdc2823
commit
b888bfe81d
|
@ -61,7 +61,7 @@ WrkBenchmarker.prototype.create = function(options) {
|
|||
WrkBenchmarker.prototype.processResults = function(output) {
|
||||
const match = output.match(this.regexp);
|
||||
const result = match && +match[1];
|
||||
if (!result) {
|
||||
if (!isFinite(result)) {
|
||||
return undefined;
|
||||
} else {
|
||||
return result;
|
||||
|
@ -126,7 +126,7 @@ exports.run = function(options, callback) {
|
|||
}
|
||||
|
||||
const result = benchmarker.processResults(stdout);
|
||||
if (!result) {
|
||||
if (result === undefined) {
|
||||
callback(new Error(`${options.benchmarker} produced strange output: ` +
|
||||
stdout, code));
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue