action k6

run_script

Runs an arbitrary k6 script

Run it now
View details
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.

  • scriptPath (str): Full path to the k6 test script
  • vus (int): Amount of virtual users to run the test with
  • duration (str): Duration, written as a string, ie: 1h2m3s etc

Signature

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