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/nodejs/performance-profiler.js
View on GitHub/**
* Node.js Performance Profiler
*
* CPU profiling for Node.js applications using v8-profiler.
*
* Usage:
* node performance-profiler.js
* node performance-profiler.js --profile-name my-profile
*/
const profiler = require('v8-profiler-node8');
const fs = require('fs');
const path = require('path');
class PerformanceProfiler {
constructor() {
this.activeProfiles = new Map();
}
startProfiling(name = 'profile') {
if (this.activeProfiles.has(name)) {
console.warn(`Profile ${name} is already running`);
return;
}
profiler.startProfiling(name);
this.activeProfiles.set(name, Date.now());
console.log(`Started profiling: ${name}`);
}
stopProfiling(name = 'profile') {
if (!this.activeProfiles.has(name)) {
console.warn(`Profile ${name} is not running`);
return null;
}
const profile = profiler.stopProfiling(name);
const data = profile.export();
profile.delete();
const filename = `${name}-${Date.now()}.cpuprofile`;
const filepath = path.join(process.cwd(), filename);
fs.writeFileSync(filepath, JSON.stringify(data));
const duration = Date.now() - this.activeProfiles.get(name);
this.activeProfiles.delete(name);
console.log(`Profile saved to ${filepath} (duration: ${duration}ms)`);
return filepath;
}
async profileFunction(fn, name) {
this.startProfiling(name);
try {
const result = await fn();
this.stopProfiling(name);
return result;
} catch (error) {
this.stopProfiling(name);
throw error;
}
}
}
// CLI usage
if (require.main === module) {
const args = process.argv.slice(2);
const profiler = new PerformanceProfiler();
const profileName = args.find(arg => arg.startsWith('--profile-name'))?.split('=')[1] || 'profile';
const duration = parseInt(args.find(arg => arg.startsWith('--duration'))?.split('=')[1] || '30') * 1000;
console.log(`Starting profile: ${profileName} for ${duration}ms`);
profiler.startProfiling(profileName);
setTimeout(() => {
profiler.stopProfiling(profileName);
process.exit(0);
}, duration);
}
module.exports = PerformanceProfiler;
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 |