Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sidorares/node-wrk
wrk load testing tool node wrapper
https://github.com/sidorares/node-wrk
Last synced: 5 days ago
JSON representation
wrk load testing tool node wrapper
- Host: GitHub
- URL: https://github.com/sidorares/node-wrk
- Owner: sidorares
- License: mit
- Created: 2014-01-08T05:00:18.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2021-02-02T23:37:36.000Z (about 4 years ago)
- Last Synced: 2025-02-03T02:41:25.520Z (12 days ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 82
- Watchers: 5
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nodejs - node-wrk - Wrk load testing tool node wrapper. ![](https://img.shields.io/github/stars/sidorares/node-wrk.svg?style=social&label=Star) (Repository / Testing)
README
# node-wrk
Prepare command line arguments and parse the output of the
[wrk](https://github.com/wg/wrk) load testing tool# example
``` js
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:- `threads`
- `connections`
- `duration`
- `printLatency`
- `headers`: object with additional request headers
- `url`: target url
- `path`: path to wrk binary (default is "wrk")
- `debug`: print the output of `wrk` to stdout
- `execOptions`: options that will be directly passed through to the `child_process.exec` of wrkCallback parameters: (err, wrkResults)
wrkResults always has:
- transferPerSec
- requestsPerSec
- requestsTotal
- durationActual
- transferTotal
- latencyAvg
- latencyStdev
- latencyStdevPerc
- latencyMax
- rpsAvg
- rpsMax
- rpsStdev
- rpsStdevPercHas these if `printLatency` is enabled
- latency50
- latency75
- latency90
- latency99And sometimes has (only if they exist):
- connectErrors
- readErrors
- writeErrors
- timeoutErrors
- non2xx3xx# install
With [npm](https://npmjs.org) do:
```
npm install wrk
```# see also
[HTTPerf.js](https://github.com/jmervine/httperfjs)# license
MIT