Permalink
Browse files

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 <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
  • Loading branch information...
mscdex committed Dec 31, 2016
1 parent 176cdc2 commit b888bfe81d39a0b528ca371c7fa1376111f9e667
Showing with 2 additions and 2 deletions.
  1. +2 −2 benchmark/_http-benchmarkers.js
@@ -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;

0 comments on commit b888bfe

Please sign in to comment.