Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Design load testing scenarios using k6, JMeter, Gatling, or Locust with ramp-up patterns, think time modeling, and performance SLI validation.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 105% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 104% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 58% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 94% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 138% | 0% |
Trigger conditions:
Use this skill when you need to design realistic, repeatable load testing scenarios with clear performance thresholds, appropriate ramp-up patterns, and tool-specific implementations for k6, JMeter, Gatling, or Locust.
Before execution, verify:
NOW_ET = 2025-10-26T02:31:21-04:00 (NIST/time.gov semantics, America/New_York)target_service is a valid URL with protocol (http/https)test_type is one of: load, stress, spike, soaksli_requirements contains numeric values for at least one metrictool (if provided) is one of: k6, jmeter, gatling, locustscenario_details (if provided) has valid numeric rangesNOW_ET; verify links resolveAbort conditions:
Goal: Generate basic load test script with simple ramp-up and assertions.
javascript import http from 'k6/http'; import { check, sleep } from 'k6';
export const options = { stages: { duration: '2m', target: 100 }, // Ramp-up { duration: '5m', target: 100 }, // Sustain { duration: '2m', target: 0 }, // Ramp-down ], thresholds: { http_req_duration: 'p(95)<500'], // 95% <500ms http_req_failed: 'rate<0.01'], // <1% errors }, };
export default function () { const res = http.get('https://api.example.com/checkout'); check(res, { 'status 200': (r) => r.status === 200 }); sleep(1); // Think time }
json { "test_config": { "tool": "k6", "virtual_users": 100, "duration_minutes": 9, "ramp_up_minutes": 2, "think_time_seconds": 1 }, "assertions": { "p95_latency_ms": 500, "error_rate_percent": 1 } }
Token budget: ≤2k tokens
Goal: Generate realistic scenarios with advanced patterns, distributed load, and comprehensive assertions.
sleep(Math.random() * 3 + 1) for 1-4s rangethresholds object with percentile syntaxassertions DSL with percentile checksToken budget: ≤6k tokens total (including T1)
Goal: Advanced patterns including distributed load, custom protocols, and comprehensive monitoring integration.
Token budget: ≤12k tokens total (including T1 + T2)
Test type selection guidance:
VU calculation (requests per second → virtual users):
VUs = (target_RPS × response_time_seconds) / (1 - think_time_ratio)
Example:
- Target: 1000 RPS
- Response time: 200ms (0.2s)
- Think time: 1s per request
- VUs = (1000 × 0.2) / (1 - 0.83) = 200 / 0.17 ≈ 1176 VUsTool selection matrix:
| Feature | k6 | JMeter | Gatling | Locust | |---------|-----|---------|---------|--------| | Ease of use | High | Medium | Medium | High | | Protocol support | HTTP/WebSocket/gRPC | Any (plugins) | HTTP/WebSocket/JMS | HTTP/Custom | | Distributed | Cloud/Enterprise | Built-in (RMI) | Enterprise | Built-in | | Scripting | JavaScript | GUI + Groovy | Scala DSL | Python | | Best for | Modern APIs, DevOps | Legacy/complex protocols | JVM apps, high load | Python devs, simple APIs |
SLI threshold recommendations (from Google SRE Book):
Stop conditions:
Required fields (all outputs):
typescriptinterface LoadTestScript { tool: "k6" | "jmeter" | "gatling" | "locust"; script_content: string; // Executable test script script_language: string; // "javascript", "xml", "scala", "python" entry_point: string; // How to execute (e.g., "k6 run script.js") } interface TestConfig { tool: string; test_type: "load" | "stress" | "spike" | "soak"; virtual_users: number | object; // Number or stages array duration_minutes: number; ramp_up_pattern: Array<{ stage: number; duration_seconds: number; target_vus: number; }>; think_time_config: { min_seconds: number; max_seconds: number; distribution: "uniform" | "normal" | "exponential"; }; distributed_config?: { enabled: boolean; load_zones?: string[]; workers?: number; }; } interface Assertions { latency_thresholds: { p50_ms?: number; p95_ms: number; p99_ms?: number; }; throughput_threshold?: { min_rps: number; }; error_rate_threshold: { max_percent: number; }; custom_checks?: Array<{ metric: string; operator: "lt" | "lte" | "gt" | "gte" | "eq"; value: number; }>; } interface ExecutionPlan { prerequisites: string[]; // Required setup steps smoke_test_command: string; // Pre-flight validation full_test_command: string; // Main execution monitoring_checklist: string[]; // What to observe during test abort_criteria: string[]; // When to stop test early success_criteria: string[]; // How to validate results report_generation?: string; // Post-test analysis steps }
Format:
test_script: Valid code for specified tool (JavaScript for k6, XML for JMeter, Scala for Gatling, Python for Locust)test_config: Valid JSONassertions: Valid JSON with numeric valuesexecution_plan: Markdown with code blocks for commandsValidation:
javascriptimport http from 'k6/http'; import { check, sleep } from 'k6'; export const options = { stages: [ { duration: '3m', target: 1000 }, { duration: '10m', target: 1000 }, { duration: '2m', target: 0 }, ], thresholds: { http_req_duration: ['p(95)<800'], http_req_failed: ['rate<0.005'], http_reqs: ['rate>500'], }, }; export default function () { const payload = JSON.stringify({ cart_id: '123', payment: 'card' }); const res = http.post( 'https://api.example.com/checkout', payload, { headers: { 'Content-Type': 'application/json' } } ); check(res, { 'status 200': (r) => r.status === 200, 'checkout success': (r) => r.json('success') }); sleep(Math.random() * 3 + 2); }
Token budgets (mandatory):
Safety checks:
Auditability:
NOW_ETDeterminism:
Validation checklist:
Primary sources (accessed 2025-10-26):
Official k6 load testing tool documentation with test lifecycle, scripting, and thresholds.
Comprehensive guide on test types, scenarios, executors, and distributed testing with k6.
Gatling load testing framework docs covering Scala DSL, simulation design, and reports.
Apache JMeter user manual with test plan creation, distributed testing, and protocols.
Locust Python-based load testing framework docs with distributed mode and custom tasks.
Google SRE principles for SLI/SLO definition, load testing strategies, and performance validation.
Additional templates:
examples/load-test-example.js for complete k6 workflow exampleresources/jmeter-template.jmx for JMeter test plan templateresources/gatling-template.scala for Gatling simulation templateRelated skills:
observability-slo-calculator (for defining SLI/SLO before load testing)testing-chaos-designer (for resilience testing under load)observability-stack-configurator (for monitoring during load tests)End of SKILL.md
Other measured skills in the registry, with their headline benchmark lift.