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

whirlwind

v1.1.0

Published

Artillery based performance testing that runs on the serverless framework, supporting high-order functions like Stress, Soak, Load, Spike and DDOS attacks

Downloads

10

Readme

Whirlwind Logo Whirlwind

Whirlwind is a performance testing library that allows you to run the following higher order functions:

  • Load
  • Spike
  • Stress
  • Soak
  • DDOS

Whirlwind uses the AWESOME Artillery.io toolkit and runs on Serverless Framework and on Amazon Lambda, allowing you to generate an insane amount of load. You can even simulate a DDOS attack by distributing the load across the globe!

For an example of how to use this, please see the whirlwind-example repository.

Setup

  1. Set permission policy for an IAM user with the following config:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "cloudformation:ListStacks",
                "cloudformation:CreateStack",
                "cloudformation:UpdateStack",
                "cloudformation:CreateChangeSet",
                "cloudformation:DescribeChangeSet",
                "cloudformation:ExecuteChangeSet",
                "cloudformation:DescribeStacks",
                "cloudformation:DescribeStackEvents",
                "cloudformation:DescribeStackResource",
                "s3:createBucket",
                "lambda:InvokeFunction",
                "s3:GetObject",
                "s3:PutObject",
                "s3:ListBucket",
                "cloudformation:ValidateTemplate",
                "iam:GetRole",
                "logs:DescribeLogGroups",
                "iam:CreateRole",
                "logs:CreateLogGroup",
                "iam:DeleteRole",
                "iam:PutRolePolicy",
                "lambda:GetFunction",
                "lambda:CreateFunction",
                "iam:PassRole",
                "lambda:ListVersionsByFunction",
                "lambda:PublishVersion",
                "lambda:UpdateFunctionCode",
                "lambda:UpdateFunctionConfiguration",
                "iam:AttachRolePolicy",
                "cloudformation:DeleteStack",
                "lambda:DeleteFunction",
                "logs:DescribeLogStreams",
                "logs:DeleteLogGroup",
                "s3:DeleteBucket"
            ],
            "Resource": "*"
        }
    ]
}
  1. Create an ~/.aws/credentials file with:
[default]
aws_access_key_id=KEY
aws_secret_access_key=KEY
  1. Make sure you have Node installed (tested with Node v8.9.3 and may work with higher).

  2. Export these ENV variables:

export INFLUX_HOST=<your ip>
export INFLUX_PASSWORD=<your password>
export INFLUX_USER=<your user>
export INFLUX_DB=<the database>
export TARGET_HOST=<target host>

Optional steps:

Route all Lambda traffic through 1 IP address

You may want to send all requests from 1 IP address, for example to test a server may still be in development and not accessible from Internet. With AWS VPC and NAT gateway it's possible to run all Lambda functions in a private subnet and route all the traffic through a leased IP address.

Here is a video how to configure this on AWS side:

Setting up Lambdas to use a static IP address

and a tutorial: How to setup a VPC for Lambdas

You also need to setup securityGroupIds and subnetIds in your serverless.yml file. You can see a commented example in the file in this repo. A securityGroup is defined in VPC Dashboard -> Security -> Security Groups, you can use a default security group with open internet access.

Setup an EC2 influxDB server for logging test results and errors

You can install InfluxDB on a t2.micro (or higher) instance with Ubuntu 16.04. First run apt-get update and apt-get upgrade then follow official installation tutorial Installing influxDB

You then need to setup access to influxDB over the internet by following this tutorial.

Finally you need to open port 5001 (this is a default port for influxDB, you can choose a different port) on your EC2 instance. Here is how.

Graphana

Graphana is a log watcher which can directly connect to influxDB and show your test logs in real-time. It's really easy to use and generates great looking graphs.

We used Graphana hosted on their servers. This is the "We Host It" option that you can see on this page.

Also this blog shows some usage and installation of influxDB and Graphana hosted on your server.

Credits

This project has been forked from the awesome serverless-artillery project. A huge thank you goes to the Nordstorm team for making this OSS and allowing us to build Whirlwind on top of their hard work.