Generate and run load tests with K6
Generate and run load tests to validate performance under stress.
Install: choco install k6 or brew install k6
Generate test script (tests/load/api-load.js):
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '30s', target: 20 },
{ duration: '1m', target: 50 },
{ duration: '30s', target: 0 },
],
thresholds: {
http_req_duration: ['p(95)<200'],
http_req_failed: ['rate<0.01'],
},
};
export default function () {
const res = http.get('http://localhost:5000/api/candidates');
check(res, { 'status 200': (r) => r.status === 200 });
sleep(1);
}
Run: k6 run tests/load/api-load.js
<target-url>: Base URL to test--vus=<n>: Virtual users (default: 50)--duration=<time>: Test duration (default: 30s)Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer
Tags:testing, load, k6, performance