/k6:analyzing-test-resultsfrom k6
Interprets k6 test output, analyzes performance metrics (response times, error rates, percentiles), identifies bottlenecks, and provides optimization recommendations.
Ships in k6. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Interpret k6 test output, identify performance bottlenecks, and provide optimization recommendations.
Written for k6 v2.3.0 (current stable). The v1.8.x maintenance line is supported where noted; differences are marked v1.x: inline. Before interpreting output or proposing output configuration, determine which k6 produced it:
k6 version where the test ran (prints k6 v2.3.0 (...)), or read the Docker tag, the setup-k6-action k6-version input, or the k6-operator spec.runner.image. The summary layout itself is a hint: a █ TOTAL RESULTS block means v1.0.0+; a flat metric list is the legacy format (pre-v1.0 or --summary-mode=legacy, removed in v2.0.0).Version notes for this skill:
--summary-mode accepts compact (default), full, and disabled. legacy and the --no-summary flag were removed in v2.0.0. v1.x: both still work but are deprecated.handleSummaryTimeout / K6_HANDLE_SUMMARY_TIMEOUT (default 120s) needs v2.2.0+. v1.x: the 120 s budget is fixed.K6_OTEL_EXPORTER_PROTOCOL=grpc|http/protobuf (v2.0.0+). v1.x: K6_OTEL_EXPORTER_TYPE=grpc|http. Basic auth variables need v2.1.0+.K6_PROMETHEUS_RW_LABELS needs v2.3.0+; native histograms are enabled with --features native-histograms (v2.1.0+). v1.x: K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true.browser_web_vital_fid was removed in v2.0.0. v1.x: it still appears; ignore it in favor of browser_web_vital_inp./v1/status, /v1/metrics) is off by default since v2.0.0; start k6 with --address localhost:6565 to use it. v1.x: on by default.k6 cloud run needs a stack (k6 cloud login or K6_CLOUD_STACK_ID) since v2.0.0, and --local-execution streams logs to Grafana Cloud since v2.2.0 (--no-cloud-logs to opt out).--log-ns-timestamps) need v2.3.0+.For the full feature/version matrix see /k6:operating-k6-in-ci-cd (reference/version-compatibility.md).
█ THRESHOLDS
http_req_duration
✓ 'p(95)<1500' p(95)=148.21ms
✓ 'p(90)<2000' p(90)=146.88ms
http_req_failed
✓ 'rate<0.01' rate=0.00%
█ TOTAL RESULTS
checks_total.......................: 90 13.122179/s
checks_succeeded...................: 100.00% 90 out of 90
checks_failed......................: 0.00% 0 out of 90
✓ quickpizza is up
✓ status is 200
CUSTOM
custom_waiting_time................: avg=152.355556 min=120 med=141 max=684 p(90)=147.2 p(95)=148.8
HTTP
http_req_duration..................: avg=140.36ms min=119.08ms med=140.96ms max=154.63ms p(90)=146.88ms p(95)=148.21ms
{ expected_response:true }.......: avg=140.36ms min=119.08ms med=140.96ms max=154.63ms p(90)=146.88ms p(95)=148.21ms
http_req_failed....................: 0.00% 0 out of 45
http_reqs..........................: 45 6.56109/s
EXECUTION
iteration_duration.................: avg=152.38ms min=119.37ms med=141.27ms max=684.62ms p(90)=147.11ms p(95)=148.39ms
iterations.........................: 45 6.56109/s
vus................................: 1 min=1 max=1
vus_max............................: 1 min=1 max=1
NETWORK
data_received......................: 519 kB 76 kB/s
data_sent..........................: 4.9 kB 718 B/s
checks_total / checks_succeeded / checks_failed are display-only breakdowns of the checks metric (they cannot be used in thresholds or seen by outputs), followed by each check's pass/fail line.avg, min, med, max, p(90), p(95).{ tag:value } lines are sub-metrics created by thresholds with tag filters.http_reqs rate = requests per second (RPS). http_req_failed shows the failure rate and the absolute count.http_req_blocked, http_req_connecting, http_req_tls_handshaking, http_req_sending, http_req_waiting, http_req_receiving. Use k6 run --summary-mode=full to see them (plus per-group and per-scenario sections), or request the timing breakdown from JSON output.k6 run --summary-mode=disabled turns the summary off, for example when streaming to an external output. v1.x: --no-summary also works; legacy prints the flat pre-v1.0 list.The total http_req_duration is composed of:
blocked → connecting → tls_handshaking → sending → waiting → receiving
↑
(TTFB / server time)
| Component | What It Measures | Typical Cause of High Values |
|---|---|---|
http_req_blocked | Time in queue before request starts | Connection pool exhaustion, DNS lookup |
http_req_connecting | TCP connection time | Network latency, server far away |
http_req_tls_handshaking | TLS/SSL handshake | Missing keep-alive, new connections per request |
http_req_sending | Time to send request body | Large request body, slow upload |
http_req_waiting | Server processing time (TTFB) | Slow backend, DB queries, server overload |
http_req_receiving | Time to download response | Large response body, slow network |
http_req_duration | sending + waiting + receiving | Overall request time |
See reference/bottleneck-patterns.md for detailed bottleneck analysis patterns.
See reference/metrics.md for the complete k6 metrics reference.
| Metric | Type | What to Watch |
|---|---|---|
http_req_duration | Trend | p95 and p99 — are they within SLA? |
http_req_failed | Rate | Error rate — should be < 1% for normal load |
http_reqs | Counter | Request rate (RPS) — is target throughput achieved? |
iteration_duration | Trend | Full iteration time including sleeps |
checks | Rate | Assertion pass rate — should be > 99%. Shown as checks_total/succeeded/failed in the summary |
vus | Gauge | Active VU count — did it reach target? |
| Percentile | Meaning |
|---|---|
p(50) / med | Half of requests are faster. Typical user experience. |
p(90) | 90% of requests are faster. Most users' experience. |
p(95) | 95% of requests are faster. Common SLA target. |
p(99) | 99% of requests are faster. Worst-case for most users. |
p(99.9) | 1 in 1000 requests slower. Tail latency. |
Rule of thumb: If p95 is 2x+ the median, there's likely a bottleneck affecting some requests.
Override the default summary output:
import { textSummary } from 'https://jslib.k6.io/k6-summary/0.1.0/index.js';
export function handleSummary(data) {
return {
'summary.json': JSON.stringify(data, null, 2),
stdout: textSummary(data, { indent: ' ', enableColors: true }),
};
}
Available output targets:
stdout — Console outputstderr — Error output'filename.json' — Write to file'filename.html' — Write HTML reporthandleSummary() must finish within handleSummaryTimeout (default 120s; set handleSummaryTimeout: '5m' in options or K6_HANDLE_SUMMARY_TIMEOUT, k6 v2.2.0+). v1.x: the 120 s limit is fixed, so keep the function light.
k6 run --out json=results.json script.js
k6 run --out csv=results.csv script.js
K6_OTEL_EXPORTER_PROTOCOL=grpc K6_OTEL_GRPC_EXPORTER_ENDPOINT=otel-collector:4317 \
k6 run --out opentelemetry script.js
Since k6 v1.7.0 the docs recommend OpenTelemetry over the InfluxDB output. v1.x: the protocol variable is K6_OTEL_EXPORTER_TYPE=grpc|http.
K6_PROMETHEUS_RW_SERVER_URL=http://prometheus:9090/api/v1/write \
K6_PROMETHEUS_RW_LABELS=environment=staging,job=checkout \
k6 run --out experimental-prometheus-rw script.js
K6_PROMETHEUS_RW_LABELS (v2.3.0+) separates several k6 instances writing to one Prometheus. Enable native histograms for trends with --features native-histograms (v2.1.0+).
K6_WEB_DASHBOARD=true k6 run script.js
# Dashboard at http://localhost:5665
K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=report.html k6 run script.js # also save an HTML report
k6 cloud login # interactive: token + stack, saved to the k6 config file
k6 cloud run --local-execution script.js # run locally, stream results (and logs since v2.2.0) to the cloud
k6 cloud run script.js # run on cloud load generators
# Non-interactive (CI): both variables are required since v2.0.0
K6_CLOUD_TOKEN=$TOKEN K6_CLOUD_STACK_ID=$STACK k6 cloud run --local-execution --no-cloud-logs script.js
v1.x: the stack is optional (k6 falls back to the first stack with a warning) and logs are not streamed.
See reference/visualization.md for detailed visualization options.
/k6:designing-test-scenarios/k6:generating-api-load-tests/k6:operating-k6-in-ci-cdWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub kimdoubleb/grafana-k6-skills --plugin k68 skills in this plugin
/designing-test-scenariosUse when designing k6 load profiles, choosing executors, configuring VU patterns, setting thresholds, or planning test scenarios. Use when the user asks about stress test, spike test, soak test, breakpoint test, load model, executor selection, or pass/fail criteria./generating-api-load-testsUse when creating k6 load test scripts for HTTP REST APIs, gRPC services, or WebSocket connections. Use when the user mentions load testing, performance testing, stress testing, API testing, or k6 script generation for protocol-level endpoints./generating-browser-testsUse when creating k6 browser-based performance tests, testing frontend performance, measuring Web Vitals (LCP, FCP, CLS, INP, TTFB), or automating browser interactions for load testing. Use when the user mentions browser testing, page load testing, E2E performance, or Chromium-based testing with k6./generating-tests-from-codeUse when analyzing an existing API codebase to auto-generate k6 load test scripts. Use when the user wants to create k6 tests from source code, route definitions, controllers, or middleware in frameworks like Express, NestJS, Spring Boot, FastAPI, or Django./generating-tests-from-openapiUse when generating k6 load test scripts from OpenAPI specification files (YAML or JSON). Use when the user has an OpenAPI spec, API specification, or wants to create k6 tests from API documentation defined in OpenAPI 3.0 or 3.1 format./operating-k6-in-ci-cdUse when setting up k6 in CI/CD pipelines (GitHub Actions, GitLab CI, Jenkins), configuring distributed testing with k6-operator on Kubernetes, managing k6 extensions (xk6), or checking which k6 version an environment runs and what that version supports. Use when the user wants to automate performance tests in a pipeline, run distributed load tests, pin or upgrade a k6 version, or asks whether a k6 feature exists in their version.Other plugins' skills for the same job