-
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 --num-requests/-n in favor of --run-time/-t #656
Conversation
…specify how long a test should run
locust/util/time.py
Outdated
timespan_regex = re.compile(r'((?P<hours>\d+?)h)?((?P<minutes>\d+?)m)?((?P<seconds>\d+?)s)?') | ||
parts = timespan_regex.match(time_str) | ||
if not parts: | ||
raise ValueError("Invalid time span format") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit: it'd be nice if this message showed the valid or expected formats from the docstring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
This should probably be added to the docs too, but this looks great and something we will definitely want to use 👍 |
Moved info on how to run Locust without the web UI, and how to retrieve CSV stats, into their own documentation pages. Added info about --time-limit option. Added info about --expect-slaves option.
Thanks! I've now added info to the documentation (very good point :)). I actually ended up restructuring the docs a bit, by moving out info on how to run Locust without the web UI, as well as how to retrieve CSV stats, into their own pages. It didn't really belong on the Quickstart page, and now it'll be easier to find directly from the docs index page. I'll go ahead and merge this. |
|
||
if options.run_time: | ||
if not options.no_web: | ||
logger.error("The --run-time argument can only be used together with --no-web") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it forbid this option if we are working from the web console ?
In my use-case I would find it super useful to be able to start the test from the web, and have it stopping automatically even when I am disconnected / in a meeting after some time or when I hit the stop button. This would avoid me forgetting to stop the test and act as security to avoid a test running for ever...
Am I the only one who would like this feature not restricted to the --no-web
? Should I create an issue / feature request ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would want this feature to be used with the web interface too, would be very useful.
Why was the -n/--num-requests removed ? Both mechanisms have distinct value/usage-scenarios, and I am one that really needs the -n/--num-requests capability. In short, a particular test (with plenty of sophistication in its design/operation) is needed for both typical load testing scenario, AND a separate scenario where a single execution must execute and exit as quickly as possible. Can we restore the lost functionality ? |
Yes, this would be a good feature to have. If we want to test performance for a particular number of requests rather than run-time. |
One problem with having the |
It would be perfectly reasonable (and to me acceptable) if this were addressed by making the -n/--num-requests option supported for non-distributed operation only. It could even be asserted that it only makes sense in smaller-scale testing scenarios, which would naturally fall outside distributed operation anyway. In my case, the need for it is specific to very small-scale tests that have to be executed at high iteration - the tests need to execute and completely exit as fast as possible, with only a specific and small number (often only 1) requests made. |
I think everything that works non-distributed should work when running Locust distributed as well. We could possibly accept slightly different behaviour (e.g. the exact number of requests aren't guaranteed), but I'm not keen on having totally different feature sets. Could you describe your use-case in more detail? To me, it doesn't really sound like it's a load test that you're doing. |
Its not a load test - its what would be called a "synthetic health-check" ... its a test of arbitrary complexity that can benefit from (even require) all the functionality present in a load-testing tool like JMeter or Locust, but run to completion as quickly as possible with one iteration and 1 user. |
Is there any way to stop the execution after specific number of requests are done? |
Can you exit by throwing an StopLocus exception? |
This adds the
--run-time
/-t
option that can be used, together with--no-web
, to specify the run time of a test. It also removes the-n
/--num-requests
option as discussed in #196 and #512 (which can both be closed once this is merged).