-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathprovider_grid.yaml
58 lines (50 loc) · 1.36 KB
/
provider_grid.yaml
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
# Run this file with the test-server, then specify the PORT as a parameter to this try or run script.
# Calls an endpoint to get a grid of items (parts of an image?), then puts the list of x,y coordinates on the `b` provider
vars:
port: "${PORT}"
groupRate: 1
load_pattern:
- linear:
from: 100%
to: 100%
over: 15s
providers:
a: # Counter for creating groups
range: {}
b:
response: {}
loggers:
test:
to: stdout
endpoints:
- method: POST
url: http://localhost:${port}
body: '{
"id":"image${start_pad(a, 6, "0")}",
"level":${random(11,14)},
"width":${random(6,16)},
"height":${random(6,20)}
}'
provides:
b:
select:
id: response.body.id
level: response.body.level
x: for_each[0]
y: for_each[1]
for_each:
- range(0, min(8, response.body.width)) # Grab at most 8
- range(0, min(8, response.body.height)) # Grab at most 8
where: response.status == 200 && response.body.width > 0 && response.body.height > 0
send: block
peak_load: ${groupRate}hps
- method: GET
url: http://localhost:${port}?id=${b.id}&level=${b.level}&x=${b.x}&y=${b.y}
peak_load: ${groupRate * 40}hps
logs:
test:
select:
id: b.id
level: b.level
x: b.x
y: b.y