node-wrk
Prepare command line argiments and parse the output of the wrk load testing tool
example
var wrk = require('wrk');
var conns = 1;
var results = [];
function benchmark() {
if (n == 100)
return console.log(JSON.stringify(results));
conns++;
wrk({
threads: 10,
connections: conns,
duration: '10s',
printLatency: true,
url: 'http://localhost:3000/'
}, function(err, out) {
results.push(out);
benchmark();
});
}
benchmark();
Options:
threads
connections
duration
printLatency
url
: target urlpath
: path to wrk binary (default is "wrk")
Callback parameters: (err, wrkResults) where wrkResults is a hash with
- transferPerSec
- requestsPerSec
- requestsTotal
- durationActual
- transferTotal
- latencyAvg
- latencyStdev
- latencyStdevPerc
- latencyMax
- latency50
- latency75
- latency90
- latency99
- rpsAvg
- rpsMax
- rpsStdev
- rpsStdevPerc
install
With npm do:
npm install wrk
license
MIT