Previously, the pause, resume, and scale CLI commands were used to globally control k6 execution. This executor does the same job by providing a better API that can be used to control k6 execution at runtime.
Note that, passing arguments to the scale CLI command for changing the amount of active or maximum VUs will only affect the externally controlled executor.
In addition to the common configuration options this executor also adds the following options:
|duration(required)||string||Total test duration.||-|
|vus||integer||Number of VUs to run concurrently.||-|
|maxVUs||integer||Maximum number of VUs to allow during the test run.||-|
If you want to control the number of VUs while the test is running.
Important: this is the only executor that is not supported in k6 cloud, it can only be used locally with k6 run.
In this example, we'll execute a test controllable at runtime, starting with 10 VUs up to a maximum of 50, and a total duration of 10 minutes.