Skip to content

You're Testing One Endpoint, Your Users Run Journeys

Quick Tips•
November 24, 2026

Firing one URL flat out benchmarks that endpoint and leaves the rest of your application untested, because no real user requests one URL in a loop. Users move through a sequence: they browse, open a product, add it to the cart, check out. A server handles many of those sequences at once, and the endpoint that struggles is often the one behind the second or third step, which a single-URL test never reaches.

Don't do this:

SHELL
wrk --threads 4 --connections 100 --duration 30s https://example.com/api/products

Do this instead. Script the sequence a user makes, and run each journey as its own k6 scenario, a named group of virtual users with its own count. The browsing journey gets 80 virtual users and the buying journey gets 20:

JAVASCRIPT
import http from 'k6/http'; import { sleep } from 'k6'; export const options = { scenarios: { browsing: { executor: 'constant-vus', vus: 80, duration: '5m', exec: 'browse', }, buying: { executor: 'constant-vus', vus: 20, duration: '5m', exec: 'buy', }, }, }; const jsonHeaders = { headers: { 'Content-Type': 'application/json' } }; export function browse() { const list = http.get('https://example.com/api/products'); sleep(2); const id = list.json()[0].id; http.get(`https://example.com/api/products/${id}`); sleep(3); } export function buy() { const list = http.get('https://example.com/api/products'); sleep(2); const id = list.json()[0].id; http.get(`https://example.com/api/products/${id}`); sleep(3); http.post('https://example.com/api/cart', JSON.stringify({ product_id: id }), jsonHeaders); sleep(2); http.post('https://example.com/api/checkout', null, jsonHeaders); }

Each virtual user now repeats a whole journey, so the requests hit the server in the order and the proportion real traffic would. The 80/20 split is an example, so take yours from your analytics. The exec option names the exported function a scenario runs.