Loading challenge...
Write basic k6/Locust scripts
Choose your load testing tool
Example load testing script
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
vus: 10, // Virtual Users
duration: '30s', // Test duration
};
export default function() {
const res = http.get('/api/load-test-target');
check(res, {
'status is 200': (r) => r.status === 200,
'response time < 500ms': (r) => r.timings.duration < 500,
});
sleep(1); // Think time between requests
}Write and validate your load test
Follow these steps
Select k6 (JavaScript) or Locust (Python) based on your preference and team stack.
Import HTTP module, define request function, add checks and think time.
Validate script syntax, then run with: k6 run script.js or locust -f script.py