This repository have content of course Curso de performace Testing en Node.js con K6
This repository using next api FakeApi Platzi
docker pull grafana/k6
docker run --rm -i grafana/k6 run --vus 10 --duration 30s - < first-test.js
- First Test
- Stages This test using VUs and stages, run test with 10 user in 10s.
- Smoke The smoke test is test with few users.
- Stress The stress test is test with maximum amount of users and requests.
- Spike The spike test is a test that increases the number of users in a short time..
- Load The load test is a test that we have a high average number of users and spontaneous users increase.
- Soak The soke test is a test that we have a low number of users but for a long time.
- Counter Metric Custom metric with accumulate value
- Gauge Metric Save minimum, maximum and last values
- Rate Metric Save percentage when not is zero.
- Trend Metric Result statistics values.
- Check Checks is validations in us test. Not break the test.
- Threshold Checks is validations in us test. that break the test.
- Create network for communication into containers
docker network create k6-dashboard
- Create containers into network
docker run -d --name=influxdb -p 8086:8086 -v "$(pwd)/data_test:/var/lib/influxdb" --network=k6-dashboard influxdb:1.8
docker run -d --name=grafana -p 3001:3000 --network=k6-dashboard grafana/grafana-oss
- Run test and send data to influxdb
k6 run --out influxdb=http://localhost:8086/k6dbtest stress.js
Temp: send data from container k6
docker run --rm -i --network=k6-dashboard grafana/k6 run --out influxdb=http://influxdb:8086/k6dbtest - < stress.js
- Add data source (influxdb) in grafana
using url with name container influxdb: http://influxdb:8086 and database k6dbtest
- Import dashboard with id Reference : https://grafana.com/grafana/dashboards/?search=k6