/k6-office-hours-047

k6 Office Hours session 47, https://www.youtube.com/watch?v=IW7I_vWV93A

Primary LanguageShellGNU Affero General Public License v3.0AGPL-3.0

Demos from k6 Office Hours #47 (March 25, 2022)

Note

These instructions have been updated as of k6 version 0.47.0 (fall 2023). Updates to k6 and highlighted extensions may have changed the workflow shown in the video demonstration. The following instructions should supersede those from the video.

Running the xk6-dashboard natively

Note

The xk6-dashboard extension was transferred to the Grafana organization thanks to @szkiba!

Build multiple extensions into a single Docker image

  • Generate a multi-extension Docker image of k6 using Dockerfile.
    docker build -t k6-extended:latest .

Running the xk6-output-influxdb extension within Docker

  • Start our Grafana service backed by InfluxDB
    docker compose -f influxdb/docker-compose.yml up
  • Run a test using run-influxdb.sh
    ./run-influxdb.sh scripts/ramping-arr-rate.js
  • Access the Grafana dashboard at http://localhost:3000/
  • Shutdown Docker when finished running scripts
    docker compose -f influxdb/docker-compose.yml down

Running the xk6-output-timescaledb extension within Docker

  • Start our Grafana service backed by InfluxDB
    docker compose -f timescaledb/docker-compose.yml up
  • Run a test using run-timescaledb.sh
    ./run-timescaledb.sh scripts/ramping-arr-rate.js
  • Access the Grafana dashboard at http://localhost:3000/
  • Shutdown Docker when finished running scripts
    docker compose -f timescaledb/docker-compose.yml down

Running the xk6-output-prometheus-remote extension within Docker

Important

The xk6-output-prometheus-remote extension is now built into the native k6 binary as an experimental extension. This removes the need to specially compile the extension, but does change some of the usage.

  • Start our Grafana service backed by Prometheus
    docker compose -f prometheus/docker-compose.yml up
  • Run a test using run-prometheus.sh
    ./run-prometheus.sh scripts/ramping-arr-rate.js
  • Access the Grafana dashboard at http://localhost:3000/
  • Shutdown Docker when finished running scripts
    docker compose -f prometheus/docker-compose.yml down