Skip to content

Commit

Permalink
benchmark: don't check wrk in non-http benchmark
Browse files Browse the repository at this point in the history
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: #1368
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
  • Loading branch information
JacksonTian authored and bnoordhuis committed Apr 9, 2015
1 parent b464d46 commit d2b62a4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions benchmark/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -92,14 +91,14 @@ function Benchmark(fn, options) {

var self = this;

hasWrk();
process.nextTick(function() {
self._run();
});
}

// 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;
Expand Down

0 comments on commit d2b62a4

Please sign in to comment.