How do you use group_duration?

Hi,

group_duration is a metric emitted when you use k6.group(), and you can see it in the results output if you use the --out option. See the example for JSON.

Unfortunately, this metric is not exposed to the JS runtime, so you can’t directly run checks on it, but I see how it could be useful. I’ll bring this up to the team and will let you know if it can be done.

In the meantime, see this great SO answer by @mstoykov. His first solution would work for your use case, just wrap your http.batch() call inside the timer function, and do the regular check on the returned elapsed time.

Let me know if you have issues with this.

2 Likes