2018-09-26 20:59:58 +01:00
|
|
|
# k6
|
|
|
|
|
2020-09-13 00:06:49 +01:00
|
|
|
> Open source load testing tool and SaaS for engineering teams.
|
2019-06-05 08:55:44 +01:00
|
|
|
> More information: <https://k6.io>.
|
2018-09-26 20:59:58 +01:00
|
|
|
|
|
|
|
- Run load test locally:
|
|
|
|
|
|
|
|
`k6 run {{script.js}}`
|
|
|
|
|
|
|
|
- Run load test locally with a given number of virtual users and duration:
|
|
|
|
|
|
|
|
`k6 run --vus {{10}} --duration {{30s}} {{script.js}}`
|
|
|
|
|
|
|
|
- Run load test locally with a given environment variable:
|
|
|
|
|
|
|
|
`k6 run -e {{HOSTNAME=example.com}} {{script.js}}`
|
|
|
|
|
|
|
|
- Run load test locally using InfluxDB to store results:
|
|
|
|
|
|
|
|
`k6 run --out influxdb={{http://localhost:8086/k6db}} {{script.js}}`
|
|
|
|
|
2020-09-13 00:06:49 +01:00
|
|
|
- Run load test locally and discard response bodies (significantly faster):
|
|
|
|
|
|
|
|
`k6 run --discard-response-bodies {{script.js}}`
|
|
|
|
|
|
|
|
- Run load test locally using the base javascript compatibility mode (significantly faster):
|
|
|
|
|
|
|
|
`k6 run --compatibility-mode=base {{script.js}}`
|
|
|
|
|
2018-09-26 20:59:58 +01:00
|
|
|
- Login to cloud service using secret token:
|
|
|
|
|
|
|
|
`k6 login cloud --token {{secret}}`
|
|
|
|
|
|
|
|
- Run load test on cloud infrastructure:
|
|
|
|
|
|
|
|
`k6 cloud {{script.js}}`
|