-
-
Notifications
You must be signed in to change notification settings - Fork 102
/
locustfile.py
34 lines (25 loc) · 866 Bytes
/
locustfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Usage: locust -f locustfile.py --headless --users 10 --spawn-rate 1 -H http://localhost:8000
from locust import HttpUser, task, between
class QuickstartUser(HttpUser):
wait_time = between(1, 5)
@task(10)
def home(self):
self.client.get("/", name="/home")
@task(5)
def io_task(self):
self.client.get("/io_task", name="/io_task")
@task(5)
def cpu_task(self):
self.client.get("/cpu_task", name="/cpu_task")
@task(3)
def random_sleep(self):
self.client.get("/random_sleep", name="/random_sleep")
@task(10)
def random_status(self):
self.client.get("/random_status", name="/random_status")
@task(3)
def chain(self):
self.client.get("/chain", name="/chain")
@task()
def random_sleep(self):
self.client.get("/error_test", name="/error_test")