
k6 Has a Free Load Testing Tool: Write Performance Tests in JavaScript, Run Thousands of Virtual Users
JMeter is a Java GUI from 2003. Artillery uses YAML. Locust needs Python. You want to load test your API but the tooling friction stops you. What if load tests were just JavaScript files you run from the terminal? That's k6. Write tests in JavaScript/TypeScript, execute locally or in the cloud, get instant performance metrics. Quick Start # macOS brew install k6 # Or download from https://k6.io Your First Load Test // load-test.js import http from " k6/http " ; import { check , sleep } from " k6 " ; export const options = { stages : [ { duration : " 30s " , target : 20 }, // Ramp up to 20 users { duration : " 1m " , target : 20 }, // Stay at 20 users { duration : " 10s " , target : 0 }, // Ramp down ], thresholds : { http_req_duration : [ " p(95)<500 " ], // 95% of requests under 500ms http_req_failed : [ " rate<0.01 " ], // Error rate under 1% }, }; export default function () { const res = http . get ( " https://api.example.com/users " ); check ( res , { " status is 200 " : ( r ) => r
Continue reading on Dev.to JavaScript
Opens in a new tab




