k6
action k6

# run_script

Runs an arbitrary k6 script

Run it now
View details

Type | action
Module | chaosk6.actions
Name | run_script
Return | None

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

Name | Type | Default | Required | Title | Description
--- | --- | --- | --- | --- | ---
scriptPath | string | null | No | Script | Local path to the k6 script to run
vus | integer | 1 | No | VUs | Number of virtual users to run
duration | string | ”1s” | No | Script | How 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

## Related starters

- k6
  probe k6

  ## `http`

  Probe an endpoint to make sure it responds to an http request with the expected HTTP status code
- k6
  action k6

  ## `stress_endpoint`

  Stress a single endpoint with a configurable amount of VUs
- k6
  action k6

  ## `stress_endpoint`

  Stress a single endpoint with a configurable amount of VUs