# autoscale_engine configuration for dev environment.
# Baked into the Docker image at /autoscale_engine.yaml.
#
# Set dryRun: true in the output config to disable real control-plane actions.
#
# cloudProvider and clusterScalers are auto-discovered from the control plane
# ListSharedPools API at startup. No need to configure them here.
#
engine:
  dataPlaneManagerAddr: "dataplane-manager.dataplane-manager:10000"
  metricsPort: 9100

autoscale:
  inputs:
    - uniqName: "tikv-capacity-input"
      type: "InputTiKVCapacityV1"
      interfaceVersion: "InputInterfaceV2"
      config:
        providerMode: "clusterGateway"
        controlPlaneBaseURL: "http://cluster-ng-server.cluster-ng-service"
        controlPlaneTimeoutSeconds: 30
        collectIntervalInSec: 15
        cacheRetentionMinutes: 30

  outputs:
    - uniqName: "capacity-reservation-output"
      type: "OutputCapacityReservationV1"
      interfaceVersion: "OutputInterfaceV2"
      config:
        controlPlaneBaseURL: "http://cluster-ng-server.cluster-ng-service"
        controlPlaneTimeoutSeconds: 30
        pollTimeoutMinutes: 60
        dryRun: false

  scalers:
    - uniqName: "tikv-capacity-scaler"
      type: "ScalingRouteTiKVCapacity2Reservation"
      interfaceVersion: "ClusterScalerInterfaceV2"
      inputUniqName: "tikv-capacity-input"
      outputUniqName: "capacity-reservation-output"
      defaultConfig:
        componentName: "tikv"
        componentScalerConfig:
          cpuThresholdPercent: 65
          sustainedDuration: 15m
          cpuScaleOutNodes: 3
          cpuScaleOutCooldown: 6h
          diskUsageThresholdPercent: 70
          diskRemainingThresholdGB: 800
          diskExpandGB: 500
          maxDiskSizeGB: 8192        # 8TB
          diskScaleOutNodes: 3
          diskScaleOutCooldown: 6h
          iopsThresholdPercent: 85
          iopsExpandStep: 3000
          maxIOPS: 16000
          throughputThresholdPercent: 85
          throughputExpandStepMBps: 200
          maxThroughputMBps: 1000
          iopsThroughputCooldown: 6h
          ioSustainedDuration: 10m
          diskThresholdPct: 70
          maxStaleness: 5m
          maxSampleGapFactor: 6      # MaxSampleGap = collectInterval * 6 (15s * 6 = 90s)
