Releases: grafana/xk6-python
Releases · grafana/xk6-python
v0.1.0
xk6-python v0.1.0
is here 🎉!
This is the initial release.
Status
xk6-python is currently in Proof of Concept status, but can already be used to run real k6 tests written in Python.
Check the documentation for available modules.
Usage
-
Download the archive for your operating system and extract the
k6
executable from it: Windows, Mac, Linux -
Create a k6 test script in python (script.py). The following example can be a good starting point:
load("check", "check") load("requests", "get") load("time", "sleep") options = { "vus": 5, "duration": "5s", "thresholds": { "checks": ["rate>=0.99"], }, } def default(_): resp = get("https://httpbin.test.k6.io/get") check(resp, { "is status 200": lambda r: r.status_code == 200, }) sleep(0.5)
-
Run the script with the k6 executable extracted from the release:
./k6 run script.py
-
Read the documentation about the available APIs.