k6 load testing

Design a steady-state and ramp-down

Medium70 pts~25 min
  • Steady state
  • Ramp-down
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/sdet-design-a-steady-state-and-ramp-down

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

Objective

Build a ramp-up, a steady plateau and a ramp-down, so measurements come from the stable phase.

Your task

  1. 1stages: [{ duration: '3s', target: 8 }, { duration: '8s', target: 8 }, { duration: '3s', target: 0 }].
  2. 2GET BASE_URL + "/perf/checkout", check status 200, sleep(0.5).
  3. 3Add thresholds 'http_req_failed': ['rate<0.01'].

Acceptance criteria

  • GET /perf/checkout returns 200
  • Stages include a ramp-down to 0
  • ≥ 50 requests with error rate < 1%
  • At least 50 check() calls pass

Constraints

  • Runner limits: ≤ 50 VUs, ≤ 400 requests and ≤ 20 s per run — size options accordingly.

k6 load testing · SDET · Workload modelling