HabitaNexus/monorepo / skills/system-reliability-engineering/load-testing-performance
load-testing-performance
Unverified| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 15.3 KB |
| scripts/README.md | markdown | 3.3 KB |
| scripts/k6/advanced-scenarios.js | script | 3.5 KB |
| scripts/k6/basic-load.js | script | 1.7 KB |
| scripts/k6/performance-comparison.js | script | 1.2 KB |
| scripts/k6/rust-api-load.js | script | 1.7 KB |
| scripts/k6/stress-test.js | script | 1.0 KB |
| scripts/nodejs/memory-profiler.js | script | 2.9 KB |
| scripts/nodejs/package.json | manifest | 551 B |
| scripts/nodejs/performance-profiler.js | script | 2.1 KB |
| scripts/python/capacity_calculator.py | script | 6.6 KB |
| scripts/python/requirements.txt | manifest | 109 B |
| scripts/rust/Cargo.toml | manifest | 270 B |
| scripts/rust/benches/my_benchmark.rs | script | 1.0 KB |
scripts/k6/rust-api-load.js
View on GitHub/**
* k6 Load Test for Rust API
*
* Optimized load test for Rust backend APIs.
* Expects lower latency due to Rust performance.
*
* Usage:
* k6 run rust-api-load.js
* k6 run rust-api-load.js --env BASE_URL=http://localhost:8080
*/
import http from 'k6/http';
import { check, sleep } from 'k6';
import { Rate, Trend } from 'k6/metrics';
const errorRate = new Rate('errors');
const requestDuration = new Trend('request_duration');
export const options = {
stages: [
{ duration: '2m', target: 100 },
{ duration: '5m', target: 100 },
{ duration: '2m', target: 200 },
{ duration: '5m', target: 200 },
{ duration: '2m', target: 0 },
],
thresholds: {
http_req_duration: ['p(95)<50', 'p(99)<100'], // Rust should be faster
http_req_failed: ['rate<0.01'],
},
};
export default function () {
const baseUrl = __ENV.BASE_URL || 'http://localhost:8080';
// Test health endpoint
const healthCheck = http.get(`${baseUrl}/health`, {
tags: { name: 'HealthCheck' },
});
check(healthCheck, {
'health check status 200': (r) => r.status === 200,
});
// Test API endpoint
const startTime = Date.now();
const response = http.get(`${baseUrl}/api/users`, {
headers: {
'Content-Type': 'application/json',
},
tags: { name: 'GetUsers' },
});
const duration = Date.now() - startTime;
const success = check(response, {
'status is 200': (r) => r.status === 200,
'response time < 50ms': (r) => r.timings.duration < 50,
'has users': (r) => {
try {
const data = JSON.parse(r.body);
return data.users && data.users.length > 0;
} catch {
return false;
}
},
});
errorRate.add(!success);
requestDuration.add(duration);
sleep(1);
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |