-
Notifications
You must be signed in to change notification settings - Fork 3k
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
base: master
Are you sure you want to change the base?
Remove specific users #2962
Conversation
…t-fork into remove-specific-users
Hi! Sorry for the long response time, last couple of weeks have been insanely busy. I think this looks very cool! Can you show a more complete example of how it would be used? Calling new_dispatch "manually" is a bit of a way to use Locust... |
Ah no problems @cyberw thanks for looking at this. I will get an example added (is this best placed here? Aware there is a lot here already and don't want to pollute the timeline too much, but then again some code would be nice to illustrate how this works). Also just to expand/clarify on my original explanation, the intention for this and usage would be calling through the master runner Usage would be:
Couple of things to note:
The latter is not new either but worthy of note as any future calls that percolate through to a The inverse of this is, if |
Hey, sorry again for not replying promptly. I do like this feature, but I wonder if it wouldn't make more sense to support an entirely different mode, where you always set specific User counts for the various classes instead of using weights? Probably a bit bigger change to implement, but if you're interested I'll be sure to dedicate some attention to this.
Yes, that's the right place for it. |
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
[UserA, UserB, UserC]
and are running weight 1,1,1,{"UserA": 2, "UserB": 1, "UserC": 1}
,With the changes in this pr we can now do the following:
{"UserA": 1, "UserB": 1, "UserC": 1}
,new_dispatch( self, target_user_count=2, spawn_rate=1, user_classes[UserA] )
{"UserA": 0, "UserB": 1, "UserC": 1}