Agent skill

load-test

Generate and run load tests with K6

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/load-test-erp-core-dev-eagles-claude-config

SKILL.md

Load Testing with K6

Generate and run load tests to validate performance under stress.

What To Do

  1. Install: choco install k6 or brew install k6

  2. Generate test script (tests/load/api-load.js):

    javascript
    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);
    }
    
  3. Run: k6 run tests/load/api-load.js

Arguments

  • <target-url>: Base URL to test
  • --vus=<n>: Virtual users (default: 50)
  • --duration=<time>: Test duration (default: 30s)

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results