Loading challenge...
Define performance thresholds
Define performance thresholds to automatically pass/fail your load tests
Set pass/fail criteria
Copy to your load test
import http from 'k6/http';
import { check } from 'k6';
export const options = {
vus: 50,
duration: '5m',
thresholds: {
http_req_duration: [
'p(95)<500', // P95 < 500ms
'p(99)<1000', // P99 < 1000ms
],
http_req_failed: ['rate<0.01'], // Error rate < 1%
http_reqs: ['rate>100'], // Throughput > 100 req/s
},
};
export default function() {
http.get('https://api.example.com/data');
}p(95)<500 - 95th percentile under 500msrate<0.01 - failure rate under 1%rate>100 - request rate over 100/savg<200 - average under 200msk6 thresholds guide