Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wrk

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wrk

wrk load test tool wrapper and output parser

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30K
increased by333.06%
Maintainers
2
Weekly downloads
 
Created
Source

node-wrk

Prepare command line arguments and parse the output of the wrk load testing tool

example

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,
    url: 'http://localhost:3000/'
  }, function(err, out) {
     results.push(out);
     benchmark();
  });
}
benchmark();

Options:

  • threads
  • connections
  • duration
  • printLatency
  • url: target url
  • path: path to wrk binary (default is "wrk")
  • debug: print the output of wrk to stdout

Callback parameters: (err, wrkResults)

wrkResults always has:

  • transferPerSec
  • requestsPerSec
  • requestsTotal
  • durationActual
  • transferTotal
  • latencyAvg
  • latencyStdev
  • latencyStdevPerc
  • latencyMax
  • rpsAvg
  • rpsMax
  • rpsStdev
  • rpsStdevPerc

Has these if printLatency is enabled

  • latency50
  • latency75
  • latency90
  • latency99

And sometimes has (only if they exist):

  • connectErrors
  • readErrors
  • writeErrors
  • timeoutErrors
  • non2xx3xx

install

With npm do:

npm install wrk

see also

HTTPerf.js

license

MIT

Keywords

FAQs

Package last updated on 10 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc