package
wrk load test tool wrapper and output parser
npm install wrkGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
10.9 kB
Includes dependencies.
Prepare command line arguments and parse the output of the wrk load testing tool
var wrk = require('wrk');
var conns = 1;
var results = [];
function benchmark() {
if (conns === 100) {
return console.log(results);
}
conns++;
wrk({
threads: 1,
connections: conns,
duration: '10s',
printLatency: true,
headers: { cookie: 'JSESSIONID=abcd' },
url: 'http://localhost:3000/'
}, function(err, out) {
results.push(out);
benchmark();
});
}
benchmark();Options:
threadsconnectionsdurationprintLatencyheaders: object with additional request headersurl: target urlpath: path to wrk binary (default is "wrk")debug: print the output of wrk to stdoutexecOptions: options that will be directly passed through to the child_process.exec of wrkCallback parameters: (err, wrkResults)
wrkResults always has:
Has these if printLatency is enabled
And sometimes has (only if they exist):
With npm do:
npm install wrkMIT
wraithan
xwraithanx@gmail.com