Skip to content

This repository have content of course Curso de performace Testing en Node.js con K6 Platzi

Notifications You must be signed in to change notification settings

yrguativa/performace-testing

Repository files navigation

Performance Test

This repository have content of course Curso de performace Testing en Node.js con K6

First test result

This repository using next api FakeApi Platzi

Run Test

docker pull grafana/k6
docker run --rm -i grafana/k6 run --vus 10 --duration 30s - < first-test.js

Content

  • 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.

Custom Metrics

Checks and Thresholds

  • Check Checks is validations in us test. Not break the test.
  • Threshold Checks is validations in us test. that break the test.

Dashboard

dashboard

  1. Create network for communication into containers
docker network create k6-dashboard
  1. 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
  1. 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
  1. Add data source (influxdb) in grafana

using url with name container influxdb: http://influxdb:8086 and database k6dbtest

  1. Import dashboard with id Reference : https://grafana.com/grafana/dashboards/?search=k6

About

This repository have content of course Curso de performace Testing en Node.js con K6 Platzi

Topics

Resources

Stars

Watchers

Forks