How to get Transactions per second just like jmeter

Hi everyone!
I used jmeter before,now I tried k6。
I found that the K6 Built-in metrics does not have transactions per second like jmeter,how can i get this metrics?
it looks like this

1 Like

Pass the output to json / influx db … then you can have it .

I tried it,but the result has no tps.

Hi @aliwong,
k6 has no concept named transaction, but I guess it is the same as iterations?

I am not very familiar with JMeter, but k6 has the concept of hierarchical groups, see https://k6.io/docs/using-k6/tags-and-groups and https://k6.io/docs/javascript-api/k6/group-name-fn

Each group can have many HTTP requests and other sub-groups, and when it’s done, a group_duration metric is emitted with the appropriate group tag value. And, of course, you can always use custom metrics to measure anything you want: https://k6.io/docs/using-k6/metrics#custom-metrics

Transactions in JMeter are groups in k6 - they’re just one or more requests that are bundled together as a single user action (click or page visit). It’s a bit of an arbitrary grouping, but in k6 this would be something like the counts per second of a group. @mstoykov or @ned , I’m not sure if that’s something k6 already exposes?

Otherwise, OP, if you’re just wanting to measure throughput, I’d suggest using rps - that’s a less arbitrary measure. By that I mean that if you have 100 requests, you could group that into 10 transactions of 10 requests each, but a teammate could group them into 1 transaction of 100 requests. In that situation, your tps and your teammate’s would be different even for the same test run, but your rps should be the same. So rps is a more consistent way to report.

1 Like

I’m not sure if that’s something k6 already exposes?

the only “purely” group metrics is ‘group_duration’ , but it’s a Trend so it has ‘count’ so you can use that to see how many times that group was called, and in some output probably even graph it per second.

Additionally (not related to this question ) the HTTP requests (and everything else that emits metrics) done inside the group will have a tag ‘group’ with the hierarchy of the groups they are in (as a group can have a group inside of it and so on) of its own, so that also can be used to if you want to see how many requests per second are done in some group.