K6 Script- How to get the metrics for all pages individually

Hi Team,

I have a script, which consists of four scenarios each has own load strategies. But the report in the console shows the cumulative data for all the scenarios.

But I would like to get the metrics for each page, that is each scenario separately.

How can we accomplish this?

sample script of the load applied

Hi @jeyeline,

Welcome to the forum!

It sounds like you want granular data based on each scenario. It’s not advisable to work with the summary report at the end of the test to achieve this, instead you will probably want to work with your own backend database to stream the metrics data to, and then use grafana to visualise that data in a dashboard. Take a look at this blog post for lots more details: How to visualize k6 results: guidelines for choosing the right metrics | Grafana Labs.

I also wrote a response where i outlined how i ran a test while sending the metrics to prometheus which might help get you started: K6 missing browser module metrics in Prometheus(p90, 95, min, max ...)

Let me know if that was useful or not.