Skip to content

Commit d2b62a4

Browse files
JacksonTianbnoordhuis
authored andcommitted
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: #1368 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent b464d46 commit d2b62a4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

benchmark/common.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ exports.PORT = process.env.PORT || 12346;
1616

1717
// If this is the main module, then run the benchmarks
1818
if (module === require.main) {
19-
hasWrk();
2019
var type = process.argv[2];
2120
var testFilter = process.argv[3];
2221
if (!type) {
@@ -92,14 +91,14 @@ function Benchmark(fn, options) {
9291

9392
var self = this;
9493

95-
hasWrk();
9694
process.nextTick(function() {
9795
self._run();
9896
});
9997
}
10098

10199
// benchmark an http server.
102100
Benchmark.prototype.http = function(p, args, cb) {
101+
hasWrk();
103102
var self = this;
104103
var regexp = /Requests\/sec:[ \t]+([0-9\.]+)/;
105104
var url = 'http://127.0.0.1:' + exports.PORT + p;

0 commit comments

Comments
 (0)