# aiva/config/downscale_patterns.yaml
# Defines common downscale patterns based on trigger reasons and time intervals.

patterns:
  - name: "High CPU during Peak Hours"
    description: "Downscale when CPU usage is high during peak business hours."
    trigger_reasons:
      - "cpu_utilization > 80%"
    time_intervals:
      - start: "09:00"
        end: "17:00"
    actions:
      - "reduce_replicas: 2"

  - name: "Memory Pressure Overnight"
    description: "Downscale when memory usage is high during off-peak hours."
    trigger_reasons:
      - "memory_utilization > 90%"
    time_intervals:
      - start: "22:00"
        end: "06:00"
    actions:
      - "reduce_replicas: 1"

  - name: "Low Request Rate Weekend"
    description: "Downscale when request rate is low during weekends."
    trigger_reasons:
      - "request_rate < 100"
    time_intervals:
      - days: ["Saturday", "Sunday"]
    actions:
      - "reduce_replicas: 3"

  - name: "Predictive Downscale - Low Usage"
    description: "Downscale based on predicted low usage patterns."
    trigger_reasons:
      - "predicted_request_rate < 50"
    time_intervals:
      - start: "00:00"
        end: "23:59"
    actions:
      - "reduce_replicas: 1"
