Hailstorms
Hailstorms is a distributed load test framework based on locust.io. The benefits of Hailstorm is that you can load test on an arbitrary number of machines and the only thing you need besides the Hailstorms framework is bash and Docker.
If you want it is possible to run the load from your machine without using docker. Read more in the Running locally in a virtual environment section below.
_
___( ).
. ( ).
( Hailstorm )
(___________)
/ / / · / /
/ • / / · /
᠂ / ・ · / ᛫
Setup of your own project
Before you can perform any load tests in your own project you need to initialize your working directory. The rest of this readme will assume you have choosen our selection of folders:
- hailstorm - Here the initialization will create some scripts for your convenience.
- generated - A folder where load test generated data is stored.
- scripts - Here is where you place your load test scripts.
You can select any other names for your folders but these are the once we are going to refer to later.
Start the initialization
The initialization functionality is built into the docker image so we need to call that.
Make sure you are in the directory of your load test project.
$ mkdir hailstorm # Here the help scripts are being created
$ touch hailstorm/init # We create an empty init file
$ chmod +x hailstorm/init # We make the init file executable
$ # We run the docker image romram/hailstorms with init command
$ docker run --rm -it -v ${PWD}/hailstorm:/opt/hailstorms/helpscripts romram/hailstorms init
== Validating helpscript folder ==========================================
Success!! Script generated.
Please run the newly generated init script. It is stored in your helpscripts folder.
Follow the instructions written in the terminal:
$ hailstorm/init
Beside the two folders mentioned an additional folder called generated
has been created.
Files that are generated by the script are stored here.
Normal flow from your own project
This section assumes you have initialized your project the way described in the Setup of your own project section above.
Your have gotten the sample script minimal_sample.py
installed during the setup.
Let's kick of by running that; using the help scripts that also where created.
Since the minimal_sample.py script expects the feeder web service to be running, start it in a separate terminal window like this:
$ hailstorm/start feeder
The service is listening to port 3456.
With the web service running we can type:
$ hailstorm/start local --script scripts/minimal_sample.py --profile docker
The --profile docker is necessary since localhost in this case will be the docker container instead of your computer.
Running locally in a virtual environment
This section explains how to start a load test without using docker. However the docker way is the recommended way.
This assumes that you are running from within the hailstorm project and not from a project of your own.
Set up a virtual environment
You need to create a python3 virtual environment. The setup of the virtual environment is handled by the framework.
To create a virtual environment do:
$ make virtualenv
This creates a virtual environment and installs all modules needed.
Activate the virtual environment
Since the needed modules are installed in the virtual environment we need to activate that before continuing:
$ venv/bin/activate
When this is done (venv)
is visible in the beginning of your prompt.
Running in the virtual environment
If you haven't created and activated the virtual environment yet, follow the instructions above.
Since the minimal_sample.py script expects the feeder web service to be running, start it in a separate terminal window like this:
$ make feeder
To start the minimal_sample.py script from the docs section type this:
(venv) $ hailstorms/local --script docs/samples/scripts/minimal_sample.py