public-roadmap icon indicating copy to clipboard operation
public-roadmap copied to clipboard

Adjust how to measure the response time of the browser check

Open karolinaBM opened this issue 4 years ago • 1 comments

Problem description It would be useful for me to measure how long does it take to execute a specific part of the whole browser check script. My browser checks often consist of more actions - login, configuration, and "something I actually want to measure" and I would like to consider only the duration of the last part and display it in the dashboard as a response time.

Optimal solution As an author of the browser check script, I could define the part of the script that would be measured and later displayed in the dashboards. In example, it might work as follows:

{{>login}}
{{>configure}}

timeMeasure.start()

await page.click('button')
await page.waitForSelector('.result_class')

timeMeasure.stop()

I find this to be the best option, because I would like to watch the statistics currently displayed in the dashboard but on the described adjusted response time.

Alternative solution If the above mentioned solution would not be implemented, it would be also good for me if I was able to define the output of the browser check and display it in the dashboard. This solution might work as follows:

{{>login}}
{{>configure}}

const timeStart = Date.now()

await page.click('button')
await page.waitForSelector('.result_class')

const timeStop = Date.now()
const outputValue = (timeStop - timeStart) / 1000
return outputValue

and the outputValue would be displayed in a separate column in the dashboard.

karolinaBM avatar Mar 01 '21 11:03 karolinaBM

Hi @karolinaBM what a great idea! I love it. We don't have any current plans to support this, but we are taking steps to expose more (detailed) metrics for the browser checks. I will keep this idea in mind as we dive into more granular reporting on browser checks.

tnolet avatar Mar 02 '21 09:03 tnolet