Hey folks,
today I found that locust load do support API calls, so you can grab statistics and manage it’s execution.
If you like me hear about it first time here is few examples:
Start locust task
1 |
curl -XPOST $LOCUST_URL/swarm -d"locust_count=100&hatch_rate=10" |
Get stats
1 |
curl $LOCUST_URL/stats/requests |
Stop locust task
1 |
curl $LOCUST_URL/stop |
All requests API endpoints can be found in locust source code on github
Another useful feature which is worth to mention is locust extension ability.
Using it you can add your own routes to API
1 2 3 4 5 |
from locust import web @web.app.route("/added_page") def my_added_page(): return "Another page" |
Unlike API calls extensions is documented.
Happy coding everyone!