Batch and how does it work?

Hello all, I lack a bit info on how batch works, in example we have 3 API’s, and 1000 VU for 1 min, so once you start k6 does 1000 VU first hit for 1 min the very first API, wait to finish and proceed to 2nd and 3rd ?

And then metrics and being taken of each API test ran and summed up?
We cant get metrics for each API separately :question:

Hi @sillymoomoo,

wait to finish and proceed to 2nd and 3rd ?

No, as the documentation mentions, k6 fires requests in parallel with http.batch without any guarantee about the order.

And then metrics and being taken of each API test ran and summed up?

Yes, the default summary shows the aggregated metrics across the entire list of HTTP requests generated.

We cant get metrics for each API separately :question:

You can see them using one of the available outputs so you can query by Tags where one of them is the name tag.

However, if your end goal is to get them sequentially in a single iteration then you can just use the classic functions by HTTP method like http.get and filter your metrics by tag name from an output.

1 Like