I would like to use K6 Browser to capture response times for specific events. For example I would like to know exactly how long it takes to log on and how long for the search to complete. What is the best way to do this so that the metrics can be sent to grafana.
Logon_transaction
wait for logon
Logon_transaction
Search_transaction
Wait for Search
Search_transaction
I could do the following but this information is not sent to the summary or grafana by default:
const requestDate = new Date();
// your request: await request …
const responseDate = new Date();
console.log(responseDate - requestDate)