-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocustfile.py
More file actions
42 lines (34 loc) · 1.13 KB
/
locustfile.py
File metadata and controls
42 lines (34 loc) · 1.13 KB
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
from locust import HttpUser, task, between
from datetime import datetime, timezone
class HelloWorldUser(HttpUser):
wait_time = between(1, 3)
@task
def get_products(self):
self.client.get("/v1/api/item-types") # Get items
@task
def make_order(self):
timestamp = datetime.now(timezone.utc).isoformat(timespec='milliseconds').replace('+00:00', 'Z')
self.client.post("/v1/api/orders", json={
"commandType":0,
"orderSource":0,
"location":0,
"loyaltyMemberId":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
"timestamp":timestamp,
"baristaItems":[
{"itemType":5},
{"itemType":4},
{"itemType":0},
{"itemType":2},
{"itemType":3}
],
"kitchenItems":[
{"itemType":8},
{"itemType":9},
{"itemType":6},
{"itemType":7}
],
})
@task
def get_orders(self):
self.client.get("/v1/fulfillment-orders") # Get orders
# http://192.168.1.107:5000