Runs a k6 load test script against your service. The HOST environment variable is automatically set to the base URL of the target service.
| Field | Type | Required | Constraints | Default | Description |
|---|
file | string | Yes | | | Path to the k6 script, relative to repo root (e.g. .nurburgdev/traffic.js) |
cpuCores | float | No | 0 < value ≤ 2 | 1 | CPU allocation for the k6 runner |
memoryMB | integer | No | ≤ 4096 | 512 | Memory allocation for the k6 runner |
targetName | string | No | | | Name of the service to run traffic against. Defaults to the first service |
env | table | No | | {} | Environment variables injected into the k6 runner. HOST is set automatically |
file = ".nurburgdev/traffic.js"
import http from "k6/http";
import { sleep } from "k6";
export default function () {
http.get(`${__ENV.HOST}/api/items`);
| Name | Unit | Description |
|---|
ERROR_RATE | % | HTTP API error rate over time |
P95_DURATION | ms | 95th percentile request latency over time |
P99_DURATION | ms | 99th percentile request latency over time |
AVG_DURATION | ms | Average request latency over time |
REQUEST_PER_MIN | req/min | Requests per minute |
VUS | count | Number of active virtual users over time |
PEAK_ERROR_RATE | % | Peak HTTP error rate |
PEAK_P95_LATENCY | ms | Peak P95 latency |