-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathprovider_spread.yaml
127 lines (117 loc) · 2.79 KB
/
provider_spread.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Run this file with the test-server, then specify the PORT as a parameter to this try or run script.
vars:
port: "${PORT}"
groupRate: 1
imagesPerGroup: 10
load_pattern:
- linear:
from: 100%
to: 100%
over: 5s
providers:
a: # Counter for creating groups
range: {}
x: # counter for creating images to put in groups
range: {}
b: # to continue the group APIs
response: {}
b2: # to create images
response: {}
y: # to continue the image APIs
response: {}
c:
response: {}
z:
response: {}
loggers:
test:
to: stdout
endpoints:
- method: POST
url: http://localhost:${port}
tags:
type: create group
body: '{
"a":"${start_pad(a, 6, "0")}"
}'
provides:
b:
select: response.body.a
where: response.status == 200 || response.status == 409
b2:
select: response.body.a
for_each:
- repeat(imagesPerGroup) # We need to create X copies so each image will have one
where: response.status == 200 || response.status == 409
peak_load: ${groupRate}hps
- method: POST
url: http://localhost:${port}
tags:
type: create image
body: '{
"x":"${start_pad(x, 8, "0")}",
"b":"${b2}"
}'
provides:
y:
select:
x: response.body.x
b: response.body.b
where: response.status == 200 || response.status == 409
peak_load: ${groupRate * imagesPerGroup}hps # Needs to be a higher rate to keep up with groups
- method: POST
url: http://localhost:${port}
tags:
type: create group data
body: '{
"b":"${b}",
"data":{
"subdata":"A-DATA"
}
}'
provides:
c:
select: response.body.b
where: response.status == 200
peak_load: ${groupRate}hps
- method: POST
url: http://localhost:${port}
tags:
type: create image
body: '{
"x":"${y.x}",
"b":"${y.b}",
"data":{
"subdata":"X-DATA"
}
}'
provides:
z:
select: y # Puts in the whole object (id and groupId)
where: response.status == 200
peak_load: ${groupRate * imagesPerGroup}hps # Needs to be a higher rate to keep up with groups
- method: PUT
url: http://localhost:${port}
body: '{
"c":"${c}",
"data":{
"subdata":"UPDATED-A-DATA"
}
}'
peak_load: ${groupRate}hps
logs:
test:
select: response.body.c
- method: PUT
url: http://localhost:${port}
body: '{
"x":"${z.x}",
"b":"${z.b}",
"data":{
"subdata":"UPDATED-X-DATA"
}
}'
peak_load: ${groupRate * imagesPerGroup}hps # Needs to be a higher rate to keep up with groups
logs:
test:
select: response.body.x