Agent Skills
› cosmicstack-labs/mercury-agent-skills
› performance-testing
performance-testing
GitHub提供k6/Locust性能测试自动化方案,涵盖负载、压力及尖峰测试。包含瓶颈分析流程与CI集成策略,确保系统高可用。
Trigger Scenarios
需要执行性能或压力测试
进行系统瓶颈分析与优化
配置自动化性能监控
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill performance-testing -g -y
SKILL.md
Frontmatter
{
"name": "performance-testing",
"metadata": {
"tags": [
"performance",
"testing",
"load-testing",
"k6",
"locust"
],
"author": "cosmicstack-labs",
"version": "1.0.0",
"category": "testing-qa"
},
"description": "Load, stress, spike testing with k6\/Locust, bottleneck analysis, and performance test automation"
}
Performance Testing
Load, stress, and spike test your systems to ensure reliability at scale.
Types of Performance Tests
| Type | Goal | Pattern |
|---|---|---|
| Smoke | Verify basic perf with minimal load | 1-5 users for 1 min |
| Load | Test under expected traffic | Ramp to target, hold 10-30 min |
| Stress | Find breaking point | Ramp up until failure |
| Spike | Handle sudden traffic bursts | Instant 10x load for 2-5 min |
| Endurance | Detect memory leaks over time | Sustained load for 1-24 hrs |
| Soak | Verify long-term stability | 50% load for hours |
k6 Patterns
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '2m', target: 100 }, // Ramp up
{ duration: '5m', target: 100 }, // Hold
{ duration: '1m', target: 0 }, // Ramp down
],
thresholds: {
http_req_duration: ['p(95)<500'],
http_req_failed: ['rate<0.01'],
},
};
export default function () {
const res = http.get('https://api.example.com/users');
check(res, {
'status is 200': (r) => r.status === 200,
'response time < 300ms': (r) => r.timings.duration < 300,
});
sleep(1);
}
Bottleneck Analysis Flow
- Run test → find slow endpoint
- Check DB query plans
- Check app server CPU/memory
- Check external service latency
- Add caching or optimize query
- Re-test to verify improvement
Automation
- Run smoke tests on every PR
- Run full perf suite nightly
- Alert on threshold breaches
- Track latency percentiles over time in dashboards
Version History
- 38e2523 Current 2026-07-05 19:42


