Get k6 parameters

Is there a way of accessing the passed parameters such as number of vus, duration etc.?
I am aware of context variables __VU and __ITER but I need to know the number of (max) VUs, eg. the value passed with --vus…

nevermind. found it.

solved it by accessing options.vus which gets populated when passing a number of users via --vus :slight_smile:

That would work, just keep in mind that if you use scenarios, options.vus won’t be populated and you’d have to parse options.scenarios.

And for anyone who stumbles on this in the future, soon we plan to add some additional functions in k6 that would return related information at test runtime, see Improve execution information in scripts · Issue #1320 · loadimpact/k6 · GitHub for updates.