https://github.com/luketn/docker-k6-grafana-influxdb
Demonstrates how to run load tests with containerised instances of K6, Grafana and InfluxDB
https://github.com/luketn/docker-k6-grafana-influxdb
Last synced: about 1 month ago
JSON representation
Demonstrates how to run load tests with containerised instances of K6, Grafana and InfluxDB
- Host: GitHub
- URL: https://github.com/luketn/docker-k6-grafana-influxdb
- Owner: luketn
- License: unlicense
- Created: 2020-08-08T12:10:30.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-16T00:33:43.000Z (about 1 year ago)
- Last Synced: 2024-04-14T06:18:21.049Z (about 1 year ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 146
- Watchers: 2
- Forks: 89
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-k6 - luketn/docker-k6-grafana-influxdb - Demonstrates how to run load tests with containerised instances of K6, Grafana and InfluxDB. (Examples/Templates)
README
# docker-k6-grafana-influxdb
Demonstrates how to run load tests with containerised instances of K6, Grafana and InfluxDB.#### Article
This is the accompanying source code for the following article. Please read for a detailed breakdown of the code and how K6, Grafana and InfluxDB work together using Docker Compose:https://medium.com/swlh/beautiful-load-testing-with-k6-and-docker-compose-4454edb3a2e3
#### Dashboards
The dashboard in /dashboards is adapted from the excellent K6 / Grafana dashboard here:
https://grafana.com/grafana/dashboards/2587There are only two small modifications:
* the data source is configured to use the docker created InfluxDB data source
* the time period is set to now-15m, which I feel is a better view for most tests#### Scripts
The script here is an example of a low Virtual User (VU) load test of the excellent Star Wars API:
https://swapi.dev/If you're tinkering with the script, it is just a friendly open source API, be gentle!
#### Common errors
If you encounter the error below:``` ERRO[0000] The moduleSpecifier "C:/Program Files/Git/script/load.js" couldn't be found on local disk. Make sure that you've specified the right path to the file. If you're running k6 using the Docker image make sure you have mounted the local directory (-v /local/path/:/inside/docker/path) containing your script and modules so that they're accessible by k6 from inside of the container, see https://grafana.com/docs/k6/latest/using-k6/modules/#using ```
Use the command below *(adding double slash)* to run `load.js`:
``` docker compose run k6 run //scripts//load.js ```