How to see statistics for all routes

Say that my scenario includes routes such as -

  • GET /object/{objectId}
  • GET /object/{objectId}/children

is there a reporter or some way to automatically be able to see min, max, avg, etc. for -

  • GET /object/1
  • GET /object/1/children
  • GET /object/1
  • GET /object/1/children
  • GET /object/2
  • GET /object/2/children

something like -

route, count, min, max, average
GET /object/{objectId}, 3, 1, 2, 1.5
GET /object/{objectId}/children, 3, 2, 3, 2.5

Or do I have to rate and trend instances for each of the routes?

As far as I know you have you use trends for such purpose if you want to see the results as console output. If you’re using other tools for storing results like influxdb and for viewing results like Grafana you can try to set unique request tag and then filter those results using those tags.

Hi @martinp,
welcome to the community forum :tada:

If you want them as part of the summary what suggested is what you’re looking for. Anyway, doing it for each endpoint could be very inconvenient.

Probably, the best option is to use an external output and filter metrics by the url tags provided by default from the k6/http module.

1 Like

Many thanks for the responses. I am using an influxdb output and analysing with Grafana. Now that I know that there is a default name tag that contains the URL for the request, I will have to see how to template it in Grafana so that I can group endpoints regardless of dynamic values.

It looks like what I would need to do to get my desired output is to do a regular expression on for tag(name) on the group by clause, but influxdb does not support that.

I think that I will override the default tag name for requests with something that I don’t need to regex.