k6 load testing

Define SLIs and thresholds

Medium70 pts~25 min
  • SLIs
  • SLOs
  • Thresholds
Practice app · Checkout Service

A load-testable checkout service with realistic latency that degrades under concurrency, plus a live metrics view.

BASE_URL
/api/practice
Console app
/lab/performance-testing-define-slis-and-thresholds

Your starter code already declares BASE_URL — call the API relative to it.

Objective

Define latency, error-rate and correctness SLIs for checkout and enforce them as thresholds.

Your task

  1. 1Set options { vus: 5, iterations: 50 }.
  2. 2thresholds: 'http_req_duration': ['p(95)<600'], 'http_req_failed': ['rate<0.01'], 'checks': ['rate>0.99'].
  3. 3GET BASE_URL + "/perf/checkout" and check status 200 and body status === "confirmed".

Acceptance criteria

  • GET /perf/checkout returns 200
  • Latency and error-rate thresholds are declared
  • ≥ 50 requests with error rate < 1%
  • At least 50 check() calls pass

k6 load testing · Performance Testing · Workload modelling