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

Doc needed: how to split logic across VUs #750

Closed
MattDodsonEnglish opened this issue Aug 1, 2022 · 1 comment · Fixed by #1179
Closed

Doc needed: how to split logic across VUs #750

MattDodsonEnglish opened this issue Aug 1, 2022 · 1 comment · Fixed by #1179
Labels
Area: OSS Content Improvements or additions to community/oss documentation examples Issues about a missing example

Comments

@MattDodsonEnglish
Copy link
Contributor

MattDodsonEnglish commented Aug 1, 2022

This is an extremely common user question: users want to have one script that runs different logic depending on the test conditions. For example, this is one of the most linked-to forum posts: https://community.k6.io/t/how-to-distribute-vus-across-different-scenarios-with-k6/49/3

There are also a few ways to split logic across VUs:

  • While loops using VU number
  • Split into stages
  • Using execution context variables to create a control flow (?)

A how-to guide could discuss situations when each way may be appropriate, then show example procedures.

@MattDodsonEnglish MattDodsonEnglish added Area: OSS Content Improvements or additions to community/oss documentation Type: Missing Content labels Aug 1, 2022
@MattDodsonEnglish
Copy link
Contributor Author

Idea for example use case: having active and inactive sessions, with some VUs logging in and doing things, and other VUs logging in and just sleeping.

@MattDodsonEnglish MattDodsonEnglish added examples Issues about a missing example and removed Type: Missing Content labels Nov 4, 2022
MattDodsonEnglish added a commit that referenced this issue May 17, 2023
- fixes #750 

Co-authored-by: Pepe Cano <[email protected]>
Co-authored-by: Mihail Stoykov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: OSS Content Improvements or additions to community/oss documentation examples Issues about a missing example
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant