rails db:reset db:migrate
redis-server
bundle exec rake dispatch_window_channels_monitor:run
rails s
curl -X POST \ http://localhost:3000/api/orders
replace the order id in the request body
curl -X POST \ http://localhost:3000/api/drivers/pick \ -H 'Content-Type: application/json' \ -d '{ "order_id": "69bac661-75d0-4cf1-991d-c0e8dc41910d" }'
curl -X POST \ http://localhost:3000/api/utils/flush_redis
- install locust here
pip install polling
- cd to
#{PROJECT_ROOT}/load_test/locust
locust -f locustfile.py UserLocust DriverLocust
- go to
http://127.0.0.1:8089/
for locust dashboard - start test from dashboard
#{PROJECT_ROOT}/load_test/locust/locustfile.py
Test special configs:
- DRIVER_POLL_INTERVAL:
how frequent a driver checks the order list
Locust configs:
-
host
:
The host -
min_wait
&max_wait
:
In addition to the task_set attribute, one usually wants to declare the min_wait and max_wait attributes. These are the minimum and maximum time respectively, in milliseconds, that a simulated user will wait between executing each task. min_wait and max_wait default to 1000, and therefore a locust will always wait 1 second between each task if min_wait and max_wait are not declared. -
weight
: You can run two locusts from the same file like so:locust -f locust_file.py WebUserLocust MobileUserLocust
If you wish to make one of these locusts execute more often you can set a weight attribute on those classes. Say for example, web users are three times more likely than mobile users:
class WebUserLocust(Locust):
weight = 3
....
class MobileUserLocust(Locust):
weight = 1
....