# Throttling Adjustment Policies
# Policies are evaluated in order.  The first matching policy is applied.

policies:
  - name: High CPU Load
    description: Reduce sending rate when CPU usage is high.
    threshold_type: cpu
    threshold_value: 80
    threshold_operator: '>='
    adjustment_type: rate_reduction
    adjustment_value: 20
    enabled: true

  - name: Medium CPU Load
    description: Reduce sending rate when CPU usage is medium.
    threshold_type: cpu
    threshold_value: 60
    threshold_operator: '>='
    adjustment_type: rate_reduction
    adjustment_value: 10
    enabled: true

  - name: High Memory Load
    description: Reduce sending rate when memory usage is high.
    threshold_type: memory
    threshold_value: 90
    threshold_operator: '>='
    adjustment_type: rate_reduction
    adjustment_value: 30
    enabled: true

  - name: Low Priority Mode
    description: Limit sending rate during off-peak hours.
    threshold_type: time
    threshold_value: "22:00-06:00"  # Example: 10 PM to 6 AM
    threshold_operator: 'in'
    adjustment_type: rate_limit
    adjustment_value: 50 # Limit to 50 emails per minute (example)
    enabled: false

  - name: Max Rate Limit
    description: Cap the maximum sending rate.
    threshold_type: always
    threshold_value: true
    threshold_operator: '=='
    adjustment_type: rate_limit
    adjustment_value: 1000 # Cap at 1000 emails per minute
    enabled: true