diff --git a/examples/provider_collect.yaml b/examples/provider_collect.yaml new file mode 100644 index 00000000..3e5a0463 --- /dev/null +++ b/examples/provider_collect.yaml @@ -0,0 +1,58 @@ +# Run this file with the test-server, then specify the PORT as a parameter to this try or run script. + +vars: + port: "${PORT}" + +load_pattern: + - linear: + from: 100% + to: 100% + over: 5s + +providers: + a: + range: {} + b: + response: {} + c: + response: {} + d: + response: {} + e: + response: {} + f: + response: {} + +loggers: + test: + to: stderr + +endpoints: + - method: POST + url: http://localhost:${port} + body: '{"a": ${a}}' + provides: + b: + select: response.body.a + on_demand: true + + - method: POST + declare: + c: collect(b, 10) # Get 10 + url: http://localhost:${port} + body: '{"c": ${c}}' + provides: + d: + # select: response.body.c + select: for_each[0] + for_each: + - response.body.c + on_demand: true + + - method: POST + url: http://localhost:${port} + body: '{"d": ${d}}' + peak_load: 1hps + logs: + test: + select: response.body.d \ No newline at end of file diff --git a/examples/provider_loop_with_counter.yaml b/examples/provider_loop_with_counter.yaml index 4234007b..b1a854dd 100644 --- a/examples/provider_loop_with_counter.yaml +++ b/examples/provider_loop_with_counter.yaml @@ -17,8 +17,6 @@ providers: response: {} c: response: {} - d: - response: {} loggers: test: @@ -43,8 +41,9 @@ endpoints: - method: POST url: http://localhost:${port} - body: '{"b": ${b.value}}' + body: '{"b": ${b.value},"counter": ${b.counter}}' peak_load: 5hps + # on_demand: true # We can't do on_demand due to a bug where it can't figure out that we provider for ourselves provides: b: select: