skills/testing/testing-performance/SKILL.md
Perf: k6 load/stress/spike, Locust Python, JMeter, load profiles, SLA, p50/p95/p99, flame graphs
npx skillsauth add alphaonedev/openclaw-graph testing-performanceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enables performance testing using tools like k6, Locust, and JMeter to simulate load, stress, and spike scenarios, measure metrics such as p50/p95/p99 latency, enforce SLAs, and generate flame graphs for bottleneck analysis.
Use this skill when assessing application performance under load, identifying scalability issues, validating SLAs, or optimizing code before production. Apply it in pre-release testing, CI/CD pipelines, or when debugging high-latency problems in web services or APIs.
To perform a basic load test, select a tool based on scenario: use k6 for quick scripts, Locust for Python-based customization, or JMeter for complex scenarios with UI elements. Always define a test script first, then run with specified profiles. For CI/CD, integrate as a step that triggers on code changes. Include parameterization for environments (e.g., staging vs. production) and always analyze results post-run. Example: Script a k6 test for an API endpoint, then scale it with Locust for user simulation.
For k6, run tests via CLI: k6 run -u 50 -d 1m script.js (sets 50 virtual users for 1 minute). Use thresholds like --threshold p(95)<500 to enforce p95 latency under 500ms. Script example:
import http from 'k6/http';
export default function() { http.get('https://api.example.com'); }
For Locust, start with: locust -f locustfile.py --host https://api.example.com --users 100 --spawn-rate 10 (100 users, 10 per second). Locustfile snippet:
from locust import HttpUser, task
class QuickUser(HttpUser):
@task
def endpoint(self): self.client.get("/health")
For JMeter, execute via: jmeter -n -t test_plan.jmx -l results.jtl (non-GUI mode). JMeter config in .jmx XML format includes elements like Thread Group with 50 loops and HTTP Samplers. API endpoints: If testing requires auth, set env vars like $K6_API_KEY in scripts (e.g., export K6_API_KEY=your_key before running).
Integrate this skill into workflows by wrapping commands in scripts or CI tools like GitHub Actions: e.g., run: k6 run script.js in a YAML step. For cloud services, pass auth via env vars (e.g., $LOCUST_API_TOKEN) to access protected endpoints. Combine with monitoring tools by piping outputs (e.g., k6 JSON results to Prometheus). Ensure tools are installed via package managers (e.g., npm install -g k6 or pip install locust), and use Docker images for consistency (e.g., docker run loadimpact/k6 run - < script.js). If using APIs, endpoints like k6's cloud API require $K6_CLOUD_TOKEN for uploads.
Check exit codes after runs: k6 returns non-zero for failures, e.g., threshold breaches. In scripts, wrap commands with try-catch for Locust (e.g., in Python: try: run_locust() except Exception as e: log(e)). For JMeter, parse .jtl logs for errors like "Assertion failure" and set up listeners to halt on thresholds. Common issues: Handle network errors by adding retries in scripts (e.g., k6: http.get(url, { retries: 3 })), and use verbose flags like k6 run --verbose script.js for debugging. If auth fails, verify env vars (e.g., echo $K6_API_KEY before execution).
k6 run -u 100 -d 5m script.js --threshold "http_req_duration{type:200} < 500". Analyze output for p95 latency and ensure SLA compliance.locust -f locustfile.py --host https://app.example.com --users 200 --run-time 10m. Monitor for errors and generate reports to identify bottlenecks.tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui