Group_duration vs http_req_duration


I’m creating some dashboards for k6 results in Grafana, and I wonder what is the difference between the group_duration and the http_req_duration. Both display some data for the different groups I have, but they don’t display the same values.


http_req_duration is explained in the documentation:

Total time for the request. It’s equal to http_req_sending + http_req_waiting + http_req_receiving (i.e. how long did the remote server take to process the request and respond, without the initial DNS lookup/connection times).

Whereas group_duration tracks the execution time of the entire group() function call, which may include other processing depending on your script, so this metric will be higher than http_req_duration if you’re making HTTP requests inside group(). See more details in the documentation about groups.