← Back to all products

Capacity Planning Toolkit

$39

Load forecasting models, resource utilization tracking, scaling decision frameworks, and capacity review templates.

27 files
PythonYAMLMarkdownJSON

Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

Interactive Reader (Free Preview) ⚙ Try Demo Tools Download Free Sample

File Structure 27 files

capacity-planning-toolkit/ ├── LICENSE ├── README.md ├── configs/ │ └── thresholds.yaml ├── examples/ │ └── sample_utilization.csv ├── free-sample.zip ├── guide/ │ ├── 01-capacity-planning-fundamentals.md │ ├── 02-load-forecasting-methods.md │ ├── 03-resource-utilization-tracking.md │ ├── 04-scaling-decisions-and-cost-modeling.md │ └── 05-capacity-review-process.md ├── guides/ │ └── capacity_review_guide.md ├── index.html ├── interactive.html ├── src/ │ ├── __init__.py │ ├── __pycache__/ │ │ ├── __init__.cpython-312.pyc │ │ ├── cost_model.cpython-312.pyc │ │ ├── forecaster.cpython-312.pyc │ │ ├── scaling_advisor.cpython-312.pyc │ │ └── utilization.cpython-312.pyc │ ├── cost_model.py │ ├── forecaster.py │ ├── scaling_advisor.py │ └── utilization.py └── tests/ ├── __pycache__/ │ ├── test_forecaster.cpython-312-pytest-9.0.2.pyc │ └── test_forecaster.cpython-312.pyc └── test_forecaster.py

Documentation Preview README excerpt

Capacity Planning Toolkit

A Python toolkit for infrastructure load forecasting, resource utilization tracking, scaling decisions, and cost modeling. All implementations use Python standard library only — no numpy, pandas, or scipy required.

Features

  • Load Forecasting — Linear regression, seasonal decomposition, double exponential smoothing, all implemented from scratch
  • Resource Utilization Tracking — Fleet-wide CPU/memory/disk monitoring with anomaly detection via z-score analysis
  • Scaling Advisor — Headroom-based scaling recommendations with tier-specific policies and cost-aware decisions
  • Cost Modeling — Unit economics computation, scaling cost projections, and optimization opportunity identification
  • Auto-Method Selection — Forecaster automatically picks the best algorithm based on data characteristics

File Structure


capacity-planning-toolkit/
├── README.md                             # This file
├── LICENSE                               # MIT License
├── src/
│   ├── __init__.py                       # Package initialization
│   ├── forecaster.py                     # Time-series forecasting (regression, seasonal, exponential smoothing)
│   ├── utilization.py                    # Resource utilization tracking and fleet analysis
│   ├── scaling_advisor.py                # Scaling recommendation engine
│   └── cost_model.py                     # Infrastructure cost modeling and optimization
├── tests/
│   └── test_forecaster.py               # Unit tests for forecasting engine
├── configs/
│   └── thresholds.yaml                  # Configurable thresholds and policy parameters
├── examples/
│   └── sample_utilization.csv           # Realistic utilization data (64 rows, multiple resources)
└── guides/
    └── capacity_review_guide.md         # How to conduct effective capacity reviews

Requirements

  • Python 3.10+ (uses modern type hints, union syntax)
  • Standard library only — zero external dependencies

Quick Start

1. Forecast Future Load


from src.forecaster import Forecaster, TimeSeriesPoint
from datetime import datetime, timedelta

# Load your historical utilization data
data = [
    TimeSeriesPoint(timestamp=datetime(2024, 1, 1) + timedelta(days=i), value=cpu_pct)
    for i, cpu_pct in enumerate(your_daily_cpu_data)
]

forecaster = Forecaster()
result = forecaster.auto_forecast(data, horizon_days=90)

print(f"Method selected: {result.method}")
print(f"Model fit (R²): {result.r_squared:.3f}")
for pt in result.forecast_points[:7]:  # First week
    print(f"  {pt.timestamp.date()}: {pt.value:.1f}%")

*... continues with setup instructions, usage examples, and more.*

Code Sample .py preview

src/cost_model.py """ Cost Model - Infrastructure cost analysis and unit economics. Helps answer questions like: - What does it cost to serve one request? - How does cost scale with traffic growth? - Where are the biggest cost optimization opportunities? - What's the cost difference between scaling strategies? Models infrastructure cost as a function of: - Base cost (fixed, regardless of traffic) - Variable cost (scales with utilization) - Step cost (increases at capacity thresholds) """ from dataclasses import dataclass, field from datetime import datetime, timedelta from enum import Enum from typing import Optional import math import logging logger = logging.getLogger(__name__) class CostCategory(Enum): """Categories of infrastructure cost.""" COMPUTE = "compute" # VM instances, containers, serverless invocations STORAGE = "storage" # Block storage, object storage, databases NETWORK = "network" # Data transfer, CDN, load balancers LICENSING = "licensing" # Software licenses, SaaS subscriptions SUPPORT = "support" # Cloud support plans, vendor contracts PERSONNEL = "personnel" # On-call, maintenance staff (for full cost modeling) @dataclass class CostComponent: """A single component of infrastructure cost. Attributes: name: Human-readable identifier (e.g., "web-server-fleet"). category: Which cost category this belongs to. monthly_fixed: Fixed monthly cost regardless of usage. per_unit_variable: Cost per unit of usage (per request, per GB, etc.). unit_name: What the variable unit represents. current_units: Current monthly consumption in units. step_threshold: Usage level where cost jumps (e.g., reserved tier). step_cost_increase: How much cost increases at the step. """ name: str # ... 398 more lines ...