Clarification for http_req_sending and http_req_receiving metrics

Hi,

I need a Clarification for http_req_sending and http_req_receiving metrics.

Following is the network traffic flow,

As per the above traffic flow,
http_req_sending = should be the value for #1
http_req_receiving → should be the value for #6
http_req_waiting = #2 +# 3 + #4 + #5

Could you please confirm that my understanding is correct for the above metrics?

CC: @mstoykov

2 Likes

Hi @Dilshan_Fernando,
your overview of a simple case is right but you’ve to consider that in real scenarios you probably will get more concurrency making the order not so linear. For example, potentially, 6 could start before 4, 5 have been completed but this really depends on the implementation. For this reason, if you need accurate metrics for your backend components then you need to trace them.

http_req_sending = The time elapsed between the first byte has been sent from k6 and when the latest byte has been declared sent from the Go net library.

http_req_receiving = The time elapsed between the first byte received and when the entire request has been declared completed.

http_req_waiting = The time elapsed between request sending is completed and when the first byte of the response has been received.

Hi @codebien , when executing k6 tests, the http_req_duration will be different and longer for far location compare with nearer location compare with server’s location. Example server located in US, client one in UK, one in AU, one in Asia. So how we can only calculate the execution time (include client request + receiving + server execution time) and exclude all time transfer in network by k6 metric? So I think the result k6 result will be more reliable.

Hi @duynguyenkhuong,
you have the fine-grained metrics in the HTTP response as Response.timings.<the-specific-metric> then you can combine them and create a new custom metric that includes only what you care.

Check here to see an example of how to do it.

1 Like