-
Notifications
You must be signed in to change notification settings - Fork 1.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
Release k6 v0.30.0 #1809
Release k6 v0.30.0 #1809
Conversation
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.
Nice work @na--! 👏 Just spotted some minor things.
|
||
Notice how `Loading users.json` is logged only once, but each VU uses the `users` variable like a normal JS array. The data is read only once and we have just a single copy of the huge array in memory! Behind the scenes, k6 uses a JS [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) to transparently copy only the row each VU requests in `users[randomUserID]` to it. This on-demand copying is a bit inefficient, but it's still leagues better than having a copy of the huge array in every VU! And you can avoid the copying in every iteration by pinning the data used by every VU and having `let user = users[randomUserID]` in the [init context](https://k6.io/docs/using-k6/test-life-cycle)! | ||
|
||
And yes, you can have multiple `SharedArray` objects in the same script, just make sure to give them unique names - this is what `someName` in the script above was for. Because VUs are independent JS runtimes, we need some way to differentiate between the different shared memory objects, so we require them to have unique names. These names are also the IDs that any [xk6](https://github.com/k6io/xk6) extensions would need to use to access them. |
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.
The last sentence is a bit confusing. Why mention xk6 here at all?
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.
To give some more exposure to xk6 and for SEO 🤣 But also because this feature can be useful to any xk6 plugin authors - both for accessing SharedArrays
, but also for implementing something similar to it, see https://github.com/loadimpact/k6/blob/45fff81b0b3af8d174c960450d16f5c4431ef9a4/js/common/initenv.go#L82-L84
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.
Hhmm seems out of place to me, since we'd have to expand on what you mean, and that's too much detail for the release notes. But OK.
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.
LGTM!. Mostly problems with some of the wording in the handleSummary section, and asking for some more links to relevant documentation that we(especially me) should've probably already started writing ... :(
release notes/v0.30.0.md
Outdated
|
||
And yes, you can have multiple `SharedArray` objects in the same script, just make sure to give them unique names - this is what `someName` in the script above was for. Because VUs are independent JS runtimes, we need some way to differentiate between the different shared memory objects, so we require them to have unique names. These names are also the IDs that any [xk6](https://github.com/k6io/xk6) extensions would need to use to access them. | ||
|
||
This works both locally and in the cloud. We advise everyone that deals with huge data files to wrap them in a `SharedArray` and give this new feature a try. The required script changes should be minimal, while the benefits should be significant. Hopefully, we can finally consider one of the biggest blockers k6 users have had for a long time solved! :tada: |
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.
I vote for having the required changes (with a few examples) spelled out in the docs and that being linked from here. This will at least give us something to link to whenever people ask what "wrap them in a SharedArray
" means.
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.
👍 for that, we should include it in the docs PR after we release
Codecov Report
@@ Coverage Diff @@
## master #1809 +/- ##
==========================================
- Coverage 71.61% 71.59% -0.02%
==========================================
Files 181 181
Lines 13939 13939
==========================================
- Hits 9982 9980 -2
- Misses 3324 3326 +2
Partials 633 633
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Reviewing the release notes probably is easiest by looking at them rendered: https://github.com/loadimpact/k6/blob/release-v0.30.0/release%20notes/v0.30.0.md
The current planned release date for v0.30.0 is tomorrow. Before that, I plan to make the jslib PR with the v0.0.1 JS summary functions, and hopefully also at least a WIP docs PR (help appreciated here)...