k6 #2: What Goes Inside a k6 Script? ⚡
What actually goes inside a k6 script? 🤔 Every k6 load test has 3 parts: 1️⃣ Imports → http to send requests, sleep to pause 2️⃣ options → one object describes the whole test (vus: 10, duration: ’30s’) 3️⃣ default function → what each virtual user does, again and again A few lines of JavaScript, and you can simulate real traffic on your API. ▶️ Run it: k6 run script.js…









