Skip to content

Commit 49a3d68

Browse files
committed
Added example with provider collect
1 parent fc767b6 commit 49a3d68

File tree

2 files changed

+60
-3
lines changed

2 files changed

+60
-3
lines changed

examples/provider_collect.yaml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Run this file with the test-server, then specify the PORT as a parameter to this try or run script.
2+
3+
vars:
4+
port: "${PORT}"
5+
6+
load_pattern:
7+
- linear:
8+
from: 100%
9+
to: 100%
10+
over: 5s
11+
12+
providers:
13+
a:
14+
range: {}
15+
b:
16+
response: {}
17+
c:
18+
response: {}
19+
d:
20+
response: {}
21+
e:
22+
response: {}
23+
f:
24+
response: {}
25+
26+
loggers:
27+
test:
28+
to: stderr
29+
30+
endpoints:
31+
- method: POST
32+
url: http://localhost:${port}
33+
body: '{"a": ${a}}'
34+
provides:
35+
b:
36+
select: response.body.a
37+
on_demand: true
38+
39+
- method: POST
40+
declare:
41+
c: collect(b, 10) # Get 10
42+
url: http://localhost:${port}
43+
body: '{"c": ${c}}'
44+
provides:
45+
d:
46+
# select: response.body.c
47+
select: for_each[0]
48+
for_each:
49+
- response.body.c
50+
on_demand: true
51+
52+
- method: POST
53+
url: http://localhost:${port}
54+
body: '{"d": ${d}}'
55+
peak_load: 1hps
56+
logs:
57+
test:
58+
select: response.body.d

examples/provider_loop_with_counter.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ providers:
1717
response: {}
1818
c:
1919
response: {}
20-
d:
21-
response: {}
2220

2321
loggers:
2422
test:
@@ -43,8 +41,9 @@ endpoints:
4341

4442
- method: POST
4543
url: http://localhost:${port}
46-
body: '{"b": ${b.value}}'
44+
body: '{"b": ${b.value},"counter": ${b.counter}}'
4745
peak_load: 5hps
46+
# on_demand: true # We can't do on_demand due to a bug where it can't figure out that we provider for ourselves
4847
provides:
4948
b:
5049
select:

0 commit comments

Comments
 (0)