Grafana k6 is an open-source load testing tool that makes performance testing easy and productive for engineering teams. k6 is free, developer-centric, and extensible.
Samples in this folder illustrate how to load test Spin applications.
You can find detailed installation instruction for k6 at https://grafana.com/docs/k6/latest/get-started/installation/. For example, you can install k6 on macOS using the Homebrew package manager:
# Install k6
brew install k6
To build and run the sample Spin App, run the following commands:
# Move into the scenario folder
pushd scenario
# Build the Spin App
spin build
# Run the Spin App
spin up
While tests are running, you can access tests result at http://127.0.0.1:5665.
# Enable dashboard and run smoke tests
K6_WEB_DASHBOARD=true k6 run smoke-test.js
# Enable dashboard and run smoke tests
K6_WEB_DASHBOARD=true k6 run -e JSON=1 smoke-test.js
# Enable dashboard and run stress tests
K6_WEB_DASHBOARD=true k6 run stress-test.js
# Enable dashboard and run stress tests
K6_WEB_DASHBOARD=true k6 run -e JSON=1 stress-test.js
# Enable dashboard and run breakpoint tests
K6_WEB_DASHBOARD=true k6 run breakpoint-test.js
# Enable dashboard and run breakpoint tests
K6_WEB_DASHBOARD=true k6 run -e JSON=1 breakpoint-test.js