Description
Add a capacity-planning analyzer that projects RPS, p99 latency, and resource utilization for booking-intent creation across the next N weeks based on historical traffic and known events, exporting head-room metrics.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/metrics/
- Output must be machine readable for autoscaler input
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/capacity-planning-model
- Implement changes
- Add
src/scripts/capacity-planner.ts
- Pull historical metrics; project with Holt-Winters
- Emit
capacity_headroom_ratio Prometheus gauge
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Insufficient history must return wide confidence band, not crash
- Include test output and notes
Example commit message
feat: capacity planning head-room model
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Add a capacity-planning analyzer that projects RPS, p99 latency, and resource utilization for booking-intent creation across the next N weeks based on historical traffic and known events, exporting head-room metrics.
Requirements and context
src/metrics/Suggested execution
git checkout -b feat/capacity-planning-modelsrc/scripts/capacity-planner.tscapacity_headroom_ratioPrometheus gaugeTest and commit
npm testExample commit message
feat: capacity planning head-room modelGuidelines