Relative Content

Tag Archive for pythonlocust

how to share headers among SequentialTaskSet tasks called by HttpUser class?

I need to pass headers to a sequence of API calls (all of which extend both SequentialTaskSet and ApiUser; ApiUser being an extension of HttpUser(, the Locust documentation for TaskSet told me that nesting was the best way to do that. However, I run into type errors (marked with # ERROR:). What’s the best way to fix them?

Terminate cleanly after an exact number of Task executions have occurred across multiple processes

Following on from a previous question1, I want locust to terminate a run once I’ve performed an exact number of requests across multiple Users and processes. I can track the progress on a per-User basis, but I’m struggling to communicate that to locust in a clean manner where it doesn’t try to spawn a bunch of extra Users in the dying throes of the run (which makes it complex for me to handle work assignment for each user).

Python and parameter in Locust request

Given a SequantialTask in a locust script I want to replace 73808 with the list all_pp_ids.
How can I construct the data= parameter of my post request to instead take in the list as parameter? Now it is hardcoded to 73808 but I want alle values in all_pp_ids instead.