-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathlocustfile.py
30 lines (22 loc) · 928 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
from locust import HttpLocust, TaskSet, task
'''
To run interavtively: locust --host=http://whatever
To run headless: locust --host=http://whatever --no-web -c CLIENTS -r HATCHRATE -n num_requests
'''
class TalentMAPResearchTasks(TaskSet):
@task(10)
def list_all_positions(self):
self.client.get("/api/v1/position/")
@task(10)
def search_position_grades(self):
self.client.get("/api/v1/position/?grade__code__in=05,06", name="/api/v1/position/?grade__code__in=code,code")
@task(10)
def search_position_skills(self):
self.client.get("/api/v1/position/?skill__code__in=05,06", name="/api/v1/position/?skill__code__in=code,code")
@task(1)
def search_free_text(self):
self.client.get("/api/v1/position/?q=german", name="/api/v1/position/?q=fts")
class TalentMAPLocust(HttpLocust):
task_set = TalentMAPResearchTasks
min_wait = 5000
max_wait = 15000