Http.batch time duration

Hi Team,

Problem : Capturing the response time for the batch request.

const responses = http.batch([
[‘GET’, ‘https://test.k6.io’, null, { tags: { ctype: ‘html’ } }],
[‘GET’, ‘https://test.k6.io/style.css’, null, { tags: { ctype: ‘css’ } }],
[‘GET’, ‘https://test.k6.io/images/logo.png’, null, { tags: { ctype: ‘images’ } }],
]);

I can capture the individual response time like below

console.log('Response time for single response: ‘+ responses[1].timings.duration + ’ ms’);

I can sum all the timings of individual responses for the batch response time, but that is not the correct way for the parallel request. Is there any other way to capture the timings? Guide me on this.

Hi @Gerard !

It seems like you’re looking for the Groups functionality.

Let me know if that helps,
Cheers

This is batching @olegbespalov. We call the request parallel with the help of http.batch, as the example above. I need to capture the correct response time for the batch request.