-
Notifications
You must be signed in to change notification settings - Fork 223
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
Document the importance of sleep #900
Comments
We could just link to https://www.sleepfoundation.org/how-sleep-works/why-do-we-need-sleep But to add something constructive: |
I think the most important is to document that sleep() is a bad idea for arrival rate executors. At least, sleep should not be added at the end of the iteration, as we recommend for other executors. |
On similar note ☝️ we likely should get something like delay for asynchronous code as |
I just made a small note to account for this, if someone wants to review. https://github.com/grafana/k6-docs/pull/1008/files |
#900 Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com>
For developers who don't come from a testing background, the
sleep()
function can be confusing. Why waste CPU cycles doing nothing?We have sleep recommendations in the browser recorder, a mention in the "high CPU" insight, and some mentions in k6-learn, but it'd be nice to have a more findable description, since sleep is in so many of our example scripts, and little "best practices" like this are some of the most requested docs.
The text was updated successfully, but these errors were encountered: