If you need to be able to run load tests on a project, but don’t want each developer to have to install something like Siege on their own computers in order to run them, you’ve come to the right place. I’ll outline¬†how to bundle load testing functionality with a project. We’ll make use of an open source node.js package: loadtest. These steps assume you have node.js installed.

1. Create a package.json file at the root of your project, and add loadtest as a dependency.

"devDependencies": {
    "loadtest": "*"
},

Now you can run npm install to install loadtest inside the project

 

2. Create a symbolic link in the root of your project so that the loadtest command can be run from there.

ln -s ./node_modules/loadtest/bin/loadtest.js loadtest

 

Now anybody working on the project just needs to run npm install, then they can run load testing commands such as this:

loadtest http://vvv.dev/ -c 100 -t 10

Full documentation for loadtest is here: https://www.npmjs.com/package/loadtest

Leave a reply

Your email address will not be published. Required fields are marked *