-
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
Add equal weights flag #1842
Add equal weights flag #1842
Conversation
👍👍 as for wording, I kind of prefer ”uniform” to ”same” but I’m not sure. And as you are (correctly) changing weights for Users and not just tasks, I think the parameter name is kind of confusing (as it only talks about tasks) Does this also work for TaskSets? |
I also prefer uniform, the reason I had to change it to same was because unittest thought a flag with --uniform-* was too close to --user (and could get confusing with the --u shorthand).
(Same thing happened when using just I can see why you think the parameter name is confusing, I can definitely change it. Something like Yes, I believe I tested TaskSets as well. Please let me know if there's something else I should test further. I'm new to locust (and Stripe, just joined less than a month ago) so it's definitely a possibility I missed something. |
Not sure whether there is a way, but go ahead and try. The risk of confusion should be small. —uniform-weights would be ideal.
I think the one thing you maybe havent tested is tasks specified as https://docs.locust.io/en/stable/writing-a-locustfile.html#id2 or does it work for those too? |
Unfortunately, I don't think it's possible without enabling a flag that disables abbreviations which would introduce breaking changes: https://realpython.com/command-line-interfaces-python-argparse/ I didn't test user tasks added as a dict, that's updated now. LMK if this is good to merge. |
Cool! I think you can ignore that failing test in the latest run. I’m confused by the argument parsing issue though. How come —stop-timeout doesnt collide with --show-task-ratio for example? |
Maybe —equal-weights works? |
I'm honestly not sure why the argument parsing issue is happening. I tried switching the flags to mirror the I changed the flag to --equal-weights. |
Does the name —equal-weights work then? If so, update the method name etc as well. |
Done! |
Cool! |
Hey @cyberw, when do you think this change will be released as part of an official version? Per my company's security policy, we are only allowed to use official releases rather than the "bleeding edge" as mentioned in the docs... |
You can use prereleases, right? I’m working on adding a git workflow that builds and pushes a prerelease version (something like 2.1.0devX) on every PR merge. |
Ok, that took me longer than I had hoped :) Anyways, you should now be able to do |
Awesome, thank you! Really appreciate it. |
Issue: #1838