actionk6

run_script

Runs an arbitrary k6 script

Activity as code

Below are the details and signature of the activity Python module.

Typeaction
Modulechaosk6.actions
Namerun_script
ReturnNone

Usage

JSON

{
  "name": "run-script",
  "type": "action",
  "provider": {
    "type": "python",
    "module": "chaosk6.actions",
    "func": "run_script"
  }
}

YAML

name: run-script
provider:
  func: run_script
  module: chaosk6.actions
  type: python
type: action

Arguments

NameTypeDefaultRequiredTitleDescription
scriptPathstringnullNoScriptLocal path to the k6 script to run
vusinteger1NoVUsNumber of virtual users to run
durationstring“1s”NoScriptHow long to run the script for

Runs an arbitrary k6 script with a configurable amount of VUs and duration. Depending on the specs of the attacking machine, the possible VU amount may vary. For a non-customized 2019 Macbook Pro, it will cap around 250 +/- 50.

Signature

def run_script(scriptPath: str = None, vus: int = 1, duration: str = '1s'):
    pass