-
Notifications
You must be signed in to change notification settings - Fork 0
/
superWeight.py
61 lines (51 loc) · 1.42 KB
/
superWeight.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from locust import HttpLocust, TaskSet, task
class WebsiteTasks(TaskSet):
@task(8)
def index(self):
self.client.get("/locust-test")
@task(2)
def postTest(self):
self.client.post("/locust-test", json={
"AnswerSetDefinitions": {
"Id":"00000000-0000-0000-0000-000000000000",
"Name":"yes/no",
"OptionDefinitions":"[yes/no]"
}
})
@task(4)
def putTest(self):
self.client.put("/locust-test")
@task(1)
def deleteTest(self):
self.client.delete("/locust-test")
class MobileTasks(TaskSet):
@task(10)
def index(self):
self.client.get("/locust-test")
@task(1)
def postTest(self):
self.client.post("/locust-test", json={
"AnswerSetDefinitions": {
"Id":"00000000-0000-0000-0000-000000000000",
"Name":"yes/no",
"OptionDefinitions":"[yes/no]"
}
})
@task(5)
def putTest(self):
self.client.put("/locust-test")
@task(1)
def deleteTest(self):
self.client.delete("/locust-test")
class WebsiteUser(HttpLocust):
weight = 2
task_set = WebsiteTasks
host = 'http://localhost:1337'
min_wait = 5000
max_wait = 15000
class MobileUser(HttpLocust):
weight = 4
task_set = MobileTasks
host = 'http://localhost:1337'
min_wait = 5000
max_wait = 15000