Skip to content

Instantly share code, notes, and snippets.

@BlackScorp
Created July 16, 2021 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BlackScorp/acdc5b4c2d87835ac3bc2166dbe68b74 to your computer and use it in GitHub Desktop.
Save BlackScorp/acdc5b4c2d87835ac3bc2166dbe68b74 to your computer and use it in GitHub Desktop.
Locust
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
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