To access the timing information from an individual HTTP request, the Response.timings object provides the time spent on the various phases in ms. One use case of this is to use the timings in a Custom metric to make a trend for a specific endpoint.
The timings are as follows:
- blocked: equals to http_req_blocked.
- connecting: equals to http_req_connecting.
- tls_handshaking: equals to http_req_tls_handshaking.
- sending: equals to http_req_sending.
- waiting: equals to http_req_waiting.
- receiving: equals to http_req_receiving.
- duration: equals to http_req_duration.
This script gets the request duration timing for a specific GET request and logs it to the console.
The expected (partial) output looks like this: