summaryrefslogtreecommitdiff
path: root/benchmark/_http-benchmarkers.js
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2016-12-31 16:30:05 -0500
committerBrian White <mscdex@mscdex.net>2017-01-11 12:54:49 -0500
commitb888bfe81d39a0b528ca371c7fa1376111f9e667 (patch)
treed6144e5b7975081fbec4b2e2cc0e2f909f6df650 /benchmark/_http-benchmarkers.js
parent176cdc282366a9bd387dcd76dc4fd967c1a0bf37 (diff)
downloadandroid-node-v8-b888bfe81d39a0b528ca371c7fa1376111f9e667.tar.gz
android-node-v8-b888bfe81d39a0b528ca371c7fa1376111f9e667.tar.bz2
android-node-v8-b888bfe81d39a0b528ca371c7fa1376111f9e667.zip
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>
Diffstat (limited to 'benchmark/_http-benchmarkers.js')
-rw-r--r--benchmark/_http-benchmarkers.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js
index e096efc71b..235d5d0786 100644
--- a/benchmark/_http-benchmarkers.js
+++ b/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;