diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2017-01-16 02:59:13 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2017-01-31 03:03:57 +0800 |
commit | 60d77bd514d3dc65cfbb64ebb8ae1f364e8bf8eb (patch) | |
tree | 7090c026e7b5cdb9550d18be604e2d375a318800 /benchmark/common.js | |
parent | ca3d131bd42afa0c68be6aeb27623d53eae547a1 (diff) | |
download | android-node-v8-60d77bd514d3dc65cfbb64ebb8ae1f364e8bf8eb.tar.gz android-node-v8-60d77bd514d3dc65cfbb64ebb8ae1f364e8bf8eb.tar.bz2 android-node-v8-60d77bd514d3dc65cfbb64ebb8ae1f364e8bf8eb.zip |
benchmark: add progress indicator to compare.js
* Print the progress bar and the current benchmark to stderr
when stderr is TTY and stdout is not.
* Allow cli arguments without values via setting.boolArgs
* Add --no-progress option
PR-URL: https://github.com/nodejs/node/pull/10823
Fixes: https://github.com/nodejs/node/issues/8659
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Diffstat (limited to 'benchmark/common.js')
-rw-r--r-- | benchmark/common.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/benchmark/common.js b/benchmark/common.js index 4ce9501dd9..6a9b2ba0f7 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -128,6 +128,14 @@ Benchmark.prototype.http = function(options, cb) { Benchmark.prototype._run = function() { const self = this; + // If forked, report to the parent. + if (process.send) { + process.send({ + type: 'config', + name: this.name, + queueLength: this.queue.length + }); + } (function recursive(queueIndex) { const config = self.queue[queueIndex]; @@ -217,7 +225,8 @@ Benchmark.prototype.report = function(rate, elapsed) { name: this.name, conf: this.config, rate: rate, - time: elapsed[0] + elapsed[1] / 1e9 + time: elapsed[0] + elapsed[1] / 1e9, + type: 'report' }); }; |