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

shit-storm

v1.1.4

Published

Distributed online service benchmarking framework

Downloads

10

Readme

SHIT STORM - Distributed online service benchmarking framework

ShitStorm is a simple, lightweight node js framework for creating distibuted testing and benchmarking for your online services. ShitStorm was created in order to provide a simple way to send a predefined set of HTTP requests as many times and from as many different machines as your needs.

A simple use case for using ShitStorm is when you want to send a couple of different HTTP requests in a partucular order many times again and again to a remote server in order to test it's stability, availability and limitations. In such a case, running it from a single machine will your benchmark by the bounds of your machine capabilities. If you want to really put your server to test - let many machines ShitStorm it together.

Installation

$ npm install shit-storm

Usage

ShitStorm is based on a master-slave architecture, where slave instances do the actual HTTP work, and the master manages configuration. In simple words - to use ShitStorm, slave instances must be created, then one master instance should be created, configured with the public URLs of all slave instances and the actual data to send. That's it! Then just start it and let the magic happen.

The ShitStorm package contain a very simple example of a master instance and a slave instance. Let's go over it.

ShitStorm Slave Instance
var shitStorm = require('shit-storm');
shitStorm.createSlave();

Not much to configure for slave instances! Namely, only it's public port. ShitStorm slave default port is 666 Make sure you make this port is publicly available and not taken by another process. If you have to change it, simply use the optional settings parameter:

var shitStorm = require('shit-storm');
shitStorm.createSlave({
    port: 667
});

That's it! You have a slave instance up and running.

ShitStorm Master Instance

Master instance configuration requires a bit more effort. First, let's define the set of HTTP requests that we want to send

var shitStorm = require('shit-storm');
var master = shitStorm.createMaster([
    {
        host: "localhost",
        port: "8080",
        path: "/some/public/endpoint",
        method: "GET", // optional - default "GET"
        queryParams: { // optional
            userId: 17,
            otherUserId: 18
        }
    },
    {
        host: "localhost",
        port: "8080",
        path: "/some/other/public/endpoint",
        method: "POST", // optional - default "GET"
        headers: { // optional - default {}
            "Content-Type": "application/json"
        },
        body: "{\"userId\":17,\"otherUserId\":18}" // optional - default ""
    }
]);

In this case, we defined our HTTP set to contain 2 HTTP calls, first of which is a GET request to http://localhost:8080/some/public/endpoint?userId=17&otherUserId=18, the second is a POST request to http://localhost:8080/some/other/public/endpoint with content type of application/json and body:

{
    userId: 17,
    otherUserId: 18
}

NOTICE: In order to send this test case over and over again, you don't have to create a very big array, you just define the basic set, and then let ShitStorm run it iteratively.

Next, let's define our slave instances

master
        .addSlave({
            host: "localhost",
            port: 666
        })
        .addSlave({
            host: "10.0.0.4",
            port: 666
        });

Not much there, just configure each slave host and port (again, default port of slaves is 666) one by one. Lastly, let's start the test!

master.start(intervalMillis, stormCount);
// intervalMillis - the interval between two consecutive calls of each slave
// stormCount - the total number of iterations each slave should perform on the defined test set

On our example, if we run

master.start(100, 20);

Our master instance will trigger each of the 2 slaves to send 40 requests at a rate of 10 requests per second.