k6 load testing

Define latency and response time

Easy30 pts~12 min
  • Latency
  • Response time
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-latency-and-response-time

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

Objective

Measure the response time of each checkout request and express budgets on it with checks and thresholds.

Your task

  1. 1Set options { vus: 1, iterations: 15 }.
  2. 2GET BASE_URL + "/perf/checkout" and check status 200 and res.timings.duration < 1000.
  3. 3Add thresholds: 'http_req_duration': ['avg<400', 'p(95)<800'].

Acceptance criteria

  • GET /perf/checkout returns 200
  • Response time is checked
  • Thresholds are declared
  • ≥ 15 requests with p95 < 1000 ms
  • At least 15 check() calls pass

k6 load testing · Performance Testing · Foundations