import http from 'k6/http';
import { check } from 'k6';
import { Trend } from 'k6/metrics';
const getUsers = new Trend('get_users_duration');
const getOrders = new Trend('get_orders_duration');
export const options = {
vus: 100,
duration: '5m',
thresholds: {
get_users_duration: ['p(95)<300'],
get_orders_duration: ['p(95)<500'],
},
};
export default function () {
const users = http.get('https://api.example.com/users');
getUsers.add(users.timings.duration);
const orders = http.get('https://api.example.com/orders');
getOrders.add(orders.timings.duration);
}Response time percentiles (p50, p95, p99), throughput (requests/second), data transfer rates, and error rates. You can also define custom metrics for business-specific measurements.
Yes. k6 thresholds let you define SLAs like "95th percentile must be under 300ms". Tests automatically fail if thresholds are breached, making it easy to integrate with CI/CD.
Load test your REST and GraphQL APIs with up to 200 virtual users for free. Real-time metrics, JavaScript scripting, and instant results.
Run HTTP load tests against any endpoint. Support for GET, POST, PUT, DELETE with custom headers and payloads. Free for up to 200 VUs.
Complete performance testing checklist: test types, metrics to measure, tools to use, and common mistakes to avoid.