performance-testing

Write k6 and Locust load tests with SLO-based thresholds and CI integration.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/MARUCIE/openclaw-foundry --skill performance-testing-marucie
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: performance-testing
Source: https://github.com/MARUCIE/openclaw-foundry/tree/main/web/public/packs/spellbook-test-engineer/skills/performance-testing
Command: npx skills add https://github.com/MARUCIE/openclaw-foundry --skill performance-testing-marucie

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams often discover capacity limits only when production traffic crashes their service. This Skill provides a structured approach to load testing before launch or major traffic changes, covering script writing, SLO-based pass/fail thresholds, bottleneck diagnosis, and CI pipeline integration. ## Core Features & Use Cases - k6 and Locust Scripting: Ready-to-adapt templates for staged load tests, mixed-workload scenarios, and weighted user tasks, plus Go benchmark functions with benchstat comparison. - SLO-Based Thresholds: Define pass/fail criteria from production SLOs (p95/p99 latency, error rates) so pipelines automatically fail on regressions. - Bottleneck Diagnosis: A symptom-to-cause table covering connection pool exhaustion, N+1 queries, GC pressure, and memory leaks. - Use Case: Before a major product launch, run the three-phase test (baseline, ramp-up, soak) against staging, codify p99 thresholds in k6, and wire a nightly GitHub Actions job that alerts when latency degrades more than 20% from baseline. ## Quick Start Write a k6 load test for my payments API with p99 latency under 500ms and error rate below 1% as pass/fail thresholds.

Frequently Asked Questions about performance-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a k6 load test with pass/fail thresholds?▼

Define stages in the options object to ramp virtual users, then add thresholds like 'http_req_duration': ['p(95)<500'] and 'http_req_failed': ['rate<0.01']. k6 exits with a failure code if any threshold is breached, which CI pipelines can use to block merges.

k6 vs Locust: which load testing tool should I use?▼

k6 uses JavaScript and suits scripted scenarios with built-in thresholds and cloud execution. Locust uses Python, supports weighted task distributions, and offers a web UI plus headless CSV output for CI. Choose based on team language preference and reporting needs.

How do I set SLO-based thresholds for load tests?▼

Derive thresholds from production SLOs rather than arbitrary numbers, for example p99 under 500ms and error rate under 0.1%. First establish a baseline on staging, then fail builds if p99 degrades more than 20% from that baseline.

Why does latency climb as virtual users increase in load tests?▼

Rising latency with VU count usually indicates connection pool exhaustion. Confirm by checking pool wait metrics, then fix by increasing pool size or adding a connection proxy like PgBouncer.

How do I compare Go benchmark results before and after a change?▼

Run go test -bench=. -count=10 -benchmem and save output before and after the change, then use benchstat to compare the two files. Include b.ReportAllocs() and b.ResetTimer() in benchmarks for accurate allocation and timing data.

When should I not run load tests with a single generator machine?▼

A single machine saturates its network interface before the target at high VU counts, producing misleading results. Above roughly 500 virtual users, use distributed execution such as k6 Cloud or multiple Locust workers.