mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
benchmark: don't check wrk in non-http benchmark
When running a non-http benchmark, there is no need the check for the wrk tool so move the wrk check into the http method. PR-URL: https://github.com/iojs/io.js/pull/1368 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit is contained in:
parent
b464d467a2
commit
d2b62a4973
@ -16,7 +16,6 @@ exports.PORT = process.env.PORT || 12346;
|
||||
|
||||
// If this is the main module, then run the benchmarks
|
||||
if (module === require.main) {
|
||||
hasWrk();
|
||||
var type = process.argv[2];
|
||||
var testFilter = process.argv[3];
|
||||
if (!type) {
|
||||
@ -92,7 +91,6 @@ function Benchmark(fn, options) {
|
||||
|
||||
var self = this;
|
||||
|
||||
hasWrk();
|
||||
process.nextTick(function() {
|
||||
self._run();
|
||||
});
|
||||
@ -100,6 +98,7 @@ function Benchmark(fn, options) {
|
||||
|
||||
// benchmark an http server.
|
||||
Benchmark.prototype.http = function(p, args, cb) {
|
||||
hasWrk();
|
||||
var self = this;
|
||||
var regexp = /Requests\/sec:[ \t]+([0-9\.]+)/;
|
||||
var url = 'http://127.0.0.1:' + exports.PORT + p;
|
||||
|
Loading…
Reference in New Issue
Block a user