Created
July 16, 2021 05:17
-
-
Save BlackScorp/acdc5b4c2d87835ac3bc2166dbe68b74 to your computer and use it in GitHub Desktop.
Locust
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
master: | |
image: locustio/locust | |
ports: | |
- "8089:8089" | |
networks: | |
- ddev_default | |
volumes: | |
- ./:/mnt/locust | |
command: -f /mnt/locust/locustfile.py --master -H http://master:8089 | |
worker: | |
image: locustio/locust | |
networks: | |
- ddev_default | |
volumes: | |
- ./:/mnt/locust | |
command: -f /mnt/locust/locustfile.py --worker --master-host master | |
networks: | |
ddev_default: | |
external: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from locust import HttpUser, task, between | |
class WebUser(HttpUser): | |
wait_time = between(1, 2.5) | |
@task | |
def index(self): | |
self.client.get("/") | |
@task(2) | |
def login(self): | |
self.client.post("/", json={"username":"test", "password":"testtest"}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment