Home > Software engineering >  How to implement "Transaction Controller" in locust
How to implement "Transaction Controller" in locust

Time:01-25

Is there a way to make Locust measure (completed tasks/second) assuming we have more that one request in the task, as the Jmeter dose by using "Transaction Controller"

measuring performance by how many completed flows (several requests) per second

CodePudding user response:

If it were me, I would reduce your work down to a single request or action per task. You can use SequentialTasks or put TaskSets inside TaskSets to structure the work however you need it to be, then Locust will do all the work for you.

Alternatively, you can create your own User class with your code however you want and use EventHooks to manually tell Locust when stuff happens by firing a request event. You can call it with request_type as whatever label you want for tasks to be tagged with as a type and name to be whatever you want the task to be called when it reports.

CodePudding user response:

In addition to @solowalkers answer you may want to check out locust-plugins TransactionManager.

See the transaction_example* files here https://github.com/SvenskaSpel/locust-plugins/tree/master/examples

  • Related