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
rate<0.01
rate>100
avg<200
k6 thresholds guide