Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove specific users #2962

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

paulcFanDuel
Copy link

What
The modification in this PR is to enhance the existing (very useful) functionality of being able to increase the amount locust users for a specific User Class.

Changes in this pr allows us to decrease the running locust users for individual user classes (rather than all user classes) deterministically.

The functionality remains the same for normal spawn/despawn events where user classes are not specified.

Currently in locust we can

  1. Given start conditions of a locust run where we have 3 users of class types [UserA, UserB, UserC] and are running weight 1,1,1,
  2. We can individually increase UserA for example if we send a dispatch through with:
new_dispatch(
        self, target_user_count=4, spawn_rate=1, user_classes[UserA]
    )
  1. This will give us the following running users: {"UserA": 2, "UserB": 1, "UserC": 1},
  2. We do not have the ability to remove 1 running user of a specified class currently.

With the changes in this pr we can now do the following:

  1. With starting test conditions giving us the following running users: {"UserA": 1, "UserB": 1, "UserC": 1},
  2. Remove an individual running user: new_dispatch( self, target_user_count=2, spawn_rate=1, user_classes[UserA] )
  3. Result {"UserA": 0, "UserB": 1, "UserC": 1}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant