Adding or Editing Load Tests
If you want to add or edit a load test, here are the general steps (more detailed information can be found in the rest of the documentation):
- Start by finding (or creating) the corresponding
Userclass (e.g.PrimeUser).- See Locustfile for more info on working with
locustfilesandUsers.
- See Locustfile for more info on working with
- Find (or create) the
TaskSetthat defines the tasks (load tests) the user will perform.- We have
TaskSetsfor all of our users, so you may be able to add your new load test to an existing class, but one thing to keep in mind is that someTaskSetsare shared across users. - If the
TaskSetis used by multipleUserclasses, see if it makes sense for your load test to be run by all the users that use the existingTaskSetor if you should create a newTaskSetand add it to the user'stasksattribute. - See TaskSet for more info on working with
TaskSets.
- We have
- Add a task (a function/method decorated with the
@taskdecorator) to theTaskSet.- You should also decorate it with any tags you think are relevant to this task.
- Run the load test and check that your task is working properly.
- If it is, you're good to go!
- See Running Load Tests for more info on how to run load tests.