K6 browser test measure time spent with in custom section

Hello everyone,

I have a question regarding k6 browser test results. I’ve recently written a long browser test for a long flow. This flow is made out of several form sections that are being filled out. My question is, is there a way to set up some “start” and “end” marker in the code for each of the form sections, where at the end of the test, I’d be provided with an output of time spent loading for each custom marked section of the flow? Haven’t had much luck looking for an option like that.

Thank you very much for helping me to get to know k6 better

Have a nice day,

Jaroslav

Hi @Tester1337,

Welcome to the forum!

Take a look at this answer. It outlines how you could measure the duration between a start and end time, capture that result in a custom metric, which then gets displayed in the summary results.

Hope that helps!
Ankur

1 Like

Thanks Ankur, I will look into it. Also found out about groups, which looks exactly like what I am looking for