load-test
Install
mayros skill install load-test
mayros skill install [email protected]
k6/Artillery load test scripts, percentile analysis, bottleneck detection
README
load-test
Design and analyze load tests using k6 and Artillery. Covers ramp patterns, percentile analysis, threshold configuration, and bottleneck detection.
Installation
Copy this skill directory into your Mayros skills folder:
cp -r skills/load-test ~/.mayros/skills/load-test
Or install via the Skills Hub:
mayros skill install @apilium/load-test
Prerequisites
k6 is optional but recommended for executing generated scripts:
# macOS
brew install k6
# Linux (Debian/Ubuntu)
sudo gpg -k
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg \
--keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" \
| sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update && sudo apt-get install k6
# Docker
docker run --rm -i grafana/k6 run - <script.js
Artillery runs via npx without installation: npx artillery run config.yml.
Usage
Activate the skill and describe the load test scenario:
Design a stress test for POST /api/v1/orders to find the breaking point
The skill generates configurations for five test patterns:
| Pattern | Purpose | Typical Duration | |---------|---------|-----------------| | Smoke | Verify script works | 1 minute | | Load | Test expected traffic | 5-10 minutes | | Stress | Find breaking point | 10-20 minutes | | Spike | Test sudden bursts | 5 minutes | | Soak | Detect memory leaks | 1-4 hours |
Percentile Analysis
The skill focuses on tail latencies, not averages:
| Percentile | Meaning | |------------|---------| | p50 | Median -- typical user experience | | p90 | 90th percentile -- good performance indicator | | p95 | 95th percentile -- common SLA target | | p99 | 99th percentile -- worst case for most users |
Bottleneck Detection
The skill identifies bottleneck types from test results:
| Type | Evidence | Fix | |------|----------|-----| | CPU | Response time increases linearly with VUs | Optimize hot paths, scale horizontally | | Memory | Memory grows without releasing (soak test) | Fix leaks, tune GC | | Connections | Flat latency then sudden spike | Increase pool size, connection reuse | | Bandwidth | Throughput plateaus | Compress responses, use CDN | | Database | App CPU low, DB CPU high | Add indexes, read replicas, caching |
Recommended Thresholds
| Endpoint Type | p95 Target | Max Error Rate | |---------------|-----------|----------------| | Health check | < 100ms | < 0.1% | | REST API (read) | < 300ms | < 1% | | REST API (write) | < 500ms | < 1% | | Web page (SSR) | < 2000ms | < 1% |
Semantic Predicates
| Predicate | Description |
|-----------|-------------|
| loadtest:designed | A load test configuration was produced |
| loadtest:bottleneck_found | A bottleneck was identified in results |
| loadtest:result_context | Namespace-level load test history |
License
MIT
Versions
Comments
Sign in to leave a comment.
Loading comments...