-
Notifications
You must be signed in to change notification settings - Fork 221
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
Reworks "life cycle" explanation page #624
Closed
Closed
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
931ba19
Reworks "life cycle" explanation page
MattDodsonEnglish 9c5cd2f
life cycle, makes list consistent and parallel
MattDodsonEnglish 3784c54
life-cycle, restructures section and table
MattDodsonEnglish a1fb10c
Makes table more accurate
MattDodsonEnglish 9508949
life-cycle, removes unnecessary details
MattDodsonEnglish 9638337
life-cycle, more informative intro
MattDodsonEnglish 85bef48
fixes nested bullets
MattDodsonEnglish 534db8c
lifecycle, restructure, adds diagram and def list
MattDodsonEnglish 09a9bb7
small text fixes
MattDodsonEnglish 5201831
life cycle; removes unneeded info
MattDodsonEnglish 0bdedcf
better init code example
MattDodsonEnglish 894e68d
Better summary of how performance improves
MattDodsonEnglish 6ce0d9e
Merge branch 'main' into lifecycle-edits
MattDodsonEnglish 72712b9
Merge branch 'lifecycle-edits'
MattDodsonEnglish e86434d
Merge branch 'main' into lifecycle-edits
MattDodsonEnglish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe a note that it's a copy of what
setup
returns. So that it:data
. This though is likely to change as we might freeze the whole object just to make it less obvious that it won't workThere 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.
@mstoykov
Sorry, I'm a bit confused here. So, VU code can manipulate data from setup, but it can't pass that data to teardown. Is that correct?
And, in the table, I note that setup code can be used to " share data among VUs". How is this data shared. Is it from one VU to the next VU? Or does each VU grab "clean" data from the
setup
code?However it works, it seems like, if VU code can manipulate data that doesn't end up in the teardown stage, then the data is not really "passed" from Setup to VU to Default.
Rather, setup passes data in two places. Once, directly to
teardown
. And once (or many times??) directly todefault
.I've made a small diagram to illustrate how I conceive this. Excuse me, I'm sure said some inaccurate things here, but I thought it may be easier to correct than to explain :-) .
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.
more or less -yes to all of those :).
In practice implementing
data
being modified and all that modifications being visible by :Will be ... extremely complicated and (computationally) expensive especially in distributed execution. Which is why we haven't even discussed it ever. But long long time ago I made fixes so that they have separate copies - previous to that this was sometimes panicking as multiple VUs were writing to the same not thread safe structure.
edit: the data is passed to each VU separately - but that shouldn't really be depended upon or documented. We do in general really want if it's a singel copy that is just unmodifiable.
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.
Haha, this sounds pretty complicated. I think I'm just going to just suggest that it's a "copy," and leave it at that. Especially since it sounds like this data may get "frozen" in the VU stage in some later k6 version anyway.
For the people who are motivated enough to actually use this implementation in some advanced way, well they can look at the source code (and find this discussion). 🙂