Skip to content

Traffic

Runs a k6 load test script against your service. The HOST environment variable is automatically set to the base URL of the target service.

FieldTypeRequiredConstraintsDefaultDescription
filestringYesPath to the k6 script, relative to repo root (e.g. .nurburgdev/traffic.js)
cpuCoresfloatNo0 < value ≤ 21CPU allocation for the k6 runner
memoryMBintegerNo≤ 4096512Memory allocation for the k6 runner
targetNamestringNoName of the service to run traffic against. Defaults to the first service
envtableNo{}Environment variables injected into the k6 runner. HOST is set automatically
[[traffic]]
file = ".nurburgdev/traffic.js"
cpuCores = 0.5
memoryMB = 256
import http from "k6/http";
import { sleep } from "k6";
export const options = {
vus: 50,
duration: "60s",
};
export default function () {
http.get(`${__ENV.HOST}/api/items`);
sleep(0.5);
}
NameUnitDescription
ERROR_RATE%HTTP API error rate over time
P95_DURATIONms95th percentile request latency over time
P99_DURATIONms99th percentile request latency over time
AVG_DURATIONmsAverage request latency over time
REQUEST_PER_MINreq/minRequests per minute
VUScountNumber of active virtual users over time
PEAK_ERROR_RATE%Peak HTTP error rate
PEAK_P95_LATENCYmsPeak P95 latency