Record count per batch url

Hi guys,

Is there away to add counter to a batch request? I would really benefit from seeing how many responses for each url I received. Currently metrics are shown for whole batch. I am running a whole lot of parallel requests but would like more granularity per each url.
Apologies if it’s a silly question, I’m very new to k6 :slight_smile:

Thanks

Hi there, welcome to the forum :slightly_smiling_face:

http.batch() returns either an object or array of responses, one for each request you made, and in case of an array are in the same order as the passed requests. See the documentation. So you can add a counter, or process these responses however you like.

You can also correlate a response with the request using the Response.request property. See the Response documentation.

Thank you, I wasn’t clear enough of what I needed but I managed to get it working. :slight_smile: