npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

stresser

v2.1.0

Published

Stress tests HTTP(s) endpoints

Downloads

26

Readme

stresser

Stress test your http endpoint in a cool way

Overview


Install

npm i -g stresser

For legacy v1 documentation please go here


Usage

After installing and configuring you can simply run:

stresser

The options are:

Usage: stresser <URL> [options]

    Options:
        -h | --help
            Outputs this helpful information

        -t | --timeout= <milliseconds> [10000]
            Sets the time a request waits for response

        -n | --count= <number> [10]
            Sets the number of seconds

        -c | --concurrent= <number> [100]
            Sets the number of concurrent requests

        -m | --method <GET|HEAD|POST|PUT|DELETE|*> [GET]
            Sets the request method

        -b | --body <body as string>
            Sets body of the request (JSON)

        -f | --force
            Forces the stress test to stop at the requested time even if requests have not finished

        -v | --verbose <e|b|c>
            Sets verbosity
                - e: Errors
                - c: HTTP Status Codes
                - b: HTTP body

        --html=<path/to/report/file.html> [${path.join(__dirname, 'report', `report-${Date.now()}.html`)}]
            Outputs an HTML report file to location
            Set --html=false if you want to disable it

        --threads=<number> [#cpus]
            The number of cpus that will be used to stress test

Example:

stresser http://example.com/page.html -c 10000 -n 10 -t 20000 --html=/home/reports/report-$(date +%s).html --threads=16 --force


Reading the stats

Example:

  S=    10 |   T=    96 |   A=     0
  E=     0 | T/O=    96 | W/B=     0 | AVG=     0 | MIN=     0 | MAX=     0
1xx=     0 | 2xx=     0 | 3xx=     0 | 4xx=     0 | 5xx=     0
NOT FINISHED=4

Legend:

  • S = Number of Seconds since the test was started
  • T = Number of requests completed in the given amount of time
  • A = Number of requests active (still awaiting a response)
  • E = Number of requests failed
  • T/O = Number of requests timed out
  • W/B = Number of requests that contain a response body
  • AVG = Average response time in milliseconds
  • MIN = Minimum response time in milliseconds
  • MAX = Maximum response time in milliseconds
  • 1xx = Number of HTTP code 100-199 responses
  • 2xx = Number of HTTP code 200-299 responses
  • 3xx = Number of HTTP code 300-399 responses
  • 4xx = Number of HTTP code 400-499 responses
  • 5xx = Number of HTTP code 500-599 responses
  • NOT FINISHED = Number of requests that are unanswered and have been forcefully terminated (see option --force)

HTML output

The HTML file contains:

  • Aggregated stats described above
  • A bar chart with distribution of the response times
  • A line chart with second by second stats

Support

For bugs and/or feature requests please refer to the Github page.


Roadmap

  • Implement option to send custom headers ~~and custom body payload~~
  • Add pie chart with different http codes distribution
  • Implement a slave / master system in order to stress test from multiple machines, for tests big enough (10k+) where the hardware becomes a bottleneck

License

stresser is offered under MIT license. Please refer to this page for more info.