We are on k6 version 0.26.2 and having trouble migrating to 0.28.0.
With new execution engine we no longer have access to options.vusMax that would allow us to prepare execution data for default function
export function setup() {
console.log("vusMax", JSON.stringify(options.vusMax));
}
The variable is undefined now.
{
"summaryTrendStats": [
"avg",
"min",
"med",
"max",
"p(90)",
"p(95)",
"p(99)",
"p(99.9)"
],
"stages": [
{
"duration": "1s",
"target": 2
},
{
"duration": "3s",
"target": 2
},
{
"duration": "1s",
"target": 0
}
],
"rps": 2,
"batchPerHost": 0
}
export function setup() {
console.log("vusMax", JSON.stringify(options.vusMax));
}
k6 run --config options.json test.jsActual: the variable is not available
As per version 0.27.0 vusMax option was deprecated
The vusMax / K6_VUS_MAX / -m / --max option is deprecated - it was previously used for the control of the initialized VUs by the REST API. Since that has now been restricted to the externally-controlled executor, the equivalent option there is called maxVUs.
But no alternative was given to access actual options from the script.
Sorry for causing you issues with that deprecation, unfortunately there wasn't a way to avoid making that breaking change to get scenarios... :disappointed: https://github.com/loadimpact/k6/issues/1320 is the issue that you can follow for the new API.
For now, if you don't use any of the new complicated scenarios, it's easy to calculate MaxVUs yourself. If you use vus + duration, then maxVUs == vus. If you use stages, then maxVUs = max(stages.target).
Sorry for causing you issues with that deprecation, unfortunately there wasn't a way to avoid making that breaking change to get
scenarios... 馃槥 #1320 is the issue that you can follow for the new API.For now, if you don't use any of the new complicated
scenarios, it's easy to calculateMaxVUsyourself. If you usevus+duration, thenmaxVUs == vus. If you usestages, thenmaxVUs = max(stages.target).
I totally love new k6 execution engine, you guys rock and addressed most of the stuff that came to my mind when I was using it.
Thank you again for your prompt reply and working on K6 improvements, looking forward to see new features!
I'm on somewhat of a spree pruning and consolidating old k6 issues :sweat_smile: So I'm going to close this in favor of https://github.com/loadimpact/k6/issues/1320, where we already have a note about the specific problem (https://github.com/loadimpact/k6/issues/1320#issuecomment-704731921). I can't give any promises on when we'll deliver it yet, but it's a high priority issue for us so it's going to be done... soon :tm: :sweat_smile: Hopefully in the next k6 release or the one after it.
Most helpful comment
I totally love new k6 execution engine, you guys rock and addressed most of the stuff that came to my mind when I was using it.
Thank you again for your prompt reply and working on K6 improvements, looking forward to see new features!