Stress and load tests with Bombard
What if you want to run fast and simple load and/or stress test for your application.
And do not want to mess with jmeter and other heave machinery?
Here comes Bombard - extremely simple tool for specifying HTTP-requests and scenarios and running them in parallel.
Installation
pip install bombard
You write simple bombard.yaml
like that
ammo:
postsList:
url: "https://jsonplaceholder.typicode.com/posts"
Run it with
bombard
and after that you will see load test report in your terminal:
It bombards your application from parallel threads.
By default 10, but you can change that with --parallel
command line option (see full options
list with --help
).
You can specify initialization steps in prepare
section as shown in the example below.
And even use Python code - see script
section in the example.
The Python code calls ammo.getPost
- requests described in
section ammo
.
supply: # you can redefine it from command line (--supply host=http://localhost/)
host: https://jsonplaceholder.typicode.com/
prepare: # Get ids from posts
postsList:
url: "{host}posts" # use {host} from global supply
script: |
for post in resp[:3]: # add getPost requests for 1st three posts in the list
reload(ammo.getPost, id=post['id'])
ammo:
getPost:
url: "{host}posts/{id}" # use {id} from the Python script above
headers: json
You do not need to remember all this sections and names.
To list all examples run
bombard --examples
Each example you can run directly
bombard --example easy
Or you can bootstrap local playbook bombard.yaml
from any example
bombard --init --example easy
After editing the playbook run it with
bombard
See full documentation.