MATIH Platform is in active MVP development. Documentation reflects current implementation status.
8. Platform Services
Capacity Planning

Capacity Planning

The CapacityPlanningController provides resource utilization analysis and capacity forecasting. It helps platform operators understand current resource consumption, predict when capacity limits will be reached, and plan infrastructure scaling.


Resource Utilization

Endpoint: GET /api/v1/observability/capacity/utilization

Returns current resource utilization across the tenant's services.

ResourceUtilization Structure

FieldTypeDescription
serviceStringService name
cpuUtilizationdoubleCPU usage percentage
memoryUtilizationdoubleMemory usage percentage
diskUtilizationdoubleDisk usage percentage
networkUtilizationdoubleNetwork bandwidth usage
podCountintCurrent pod count
maxPodsintMaximum pods allowed
timestampInstantMeasurement time

Capacity Forecast

Endpoint: GET /api/v1/observability/capacity/forecast

Projects resource needs based on current trends.

ParameterTypeDefaultDescription
horizonString30dForecast horizon
confidencedouble0.95Confidence interval

CapacityForecast Structure

FieldTypeDescription
resourceStringResource type (cpu, memory, storage)
currentUsagedoubleCurrent usage
forecastedUsagedoubleProjected usage at horizon
timeToExhaustionStringEstimated time until capacity is full
confidenceIntervalObjectLow and high bounds
recommendationStringScaling recommendation
dataPointsListForecast time series data

Capacity Plans

Create Capacity Plan

Endpoint: POST /api/v1/observability/capacity/plans

curl -X POST http://localhost:8088/api/v1/observability/capacity/plans \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "X-Tenant-ID: 550e8400" \
  -d '{
    "name": "Q2 2026 Scaling Plan",
    "targetDate": "2026-06-30",
    "growthRate": 0.15,
    "services": ["ai-service", "query-engine"],
    "constraints": {
      "maxBudget": 50000,
      "maxCpuCores": 100,
      "maxMemoryGb": 512
    }
  }'

CapacityPlan Structure

FieldTypeDescription
idStringPlan identifier
nameStringPlan name
targetDateLocalDateTarget date for capacity needs
growthRatedoubleExpected growth rate
servicesListServices included in the plan
constraintsObjectBudget and resource constraints
recommendationsListScaling recommendations
estimatedCostBigDecimalProjected cost for the plan
statusStringdraft, approved, executing, completed

Scaling Recommendations

The capacity planning engine generates recommendations based on utilization trends:

RecommendationTrigger
Scale upResource utilization consistently above 80%
Scale downResource utilization consistently below 30%
Right-sizeResource requests significantly different from actual usage
Add replicasApproaching pod count limits
Upgrade tierApproaching quota limits