k6 load testing

Model a realistic workload mix

Medium70 pts~25 min
  • Workload model
  • Traffic mix
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-model-a-realistic-workload-mix

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

Objective

Model a traffic mix of 70% search, 20% checkout and 10% login with deterministic selection.

Your task

  1. 1Set options { vus: 5, iterations: 60 }.
  2. 2Pick the action from __ITER % 10: 0–6 → search, 7–8 → checkout, 9 → login.
  3. 3Search: GET BASE_URL + "/perf/search?q=mug"; checkout: GET BASE_URL + "/perf/checkout"; login: POST BASE_URL + "/perf/login" with JSON.stringify({ username: "qa@target.dev", password: "Test@123" }) with Content-Type: application/json.
  4. 4check status 200 for every request.

Acceptance criteria

  • Search, checkout and login are all exercised
  • ≥ 60 requests are sent
  • At least 60 check() calls pass

k6 load testing · Performance Testing · Workload modelling