github.com/gocrane/crane@v0.11.0/examples/tsp-pods-dsp.yaml (about)

     1  apiVersion: prediction.crane.io/v1alpha1
     2  kind: TimeSeriesPrediction
     3  metadata:
     4    name: tsp-pods-dsp
     5    namespace: default
     6  spec:
     7    targetRef:
     8      kind: Deployment
     9      name: dep-1-100m-500mib
    10      namespace: default
    11    predictionWindowSeconds: 3600
    12    predictionMetrics:
    13      - resourceIdentifier: workload-pods-cpu
    14        type: ExpressionQuery
    15        expressionQuery:
    16          expression: 'irate (container_cpu_usage_seconds_total{container!="",image!="",container!="POD",pod=~"^dep-1-100m-500mib-.*$"}[1m])'
    17        algorithm:
    18          algorithmType: "dsp"
    19          dsp:
    20            sampleInterval: "60s"
    21            historyLength: "3d"
    22            estimators:
    23              fft:
    24                - marginFraction: "0.2"
    25                  lowAmplitudeThreshold: "1.0"
    26                  highFrequencyThreshold: "0.05"
    27                  minNumOfSpectrumItems: 10
    28                  maxNumOfSpectrumItems: 20
    29      - resourceIdentifier: workload-pods-mem
    30        type: ExpressionQuery
    31        expressionQuery:
    32          expression: 'container_memory_working_set_bytes{container!="",image!="", container!="POD",pod=~"^dep-1-100m-500mib-.*$"}'
    33        algorithm:
    34          algorithmType: "dsp"
    35          dsp:
    36            sampleInterval: "60s"
    37            historyLength: "3d"
    38            estimators:
    39              fft:
    40                - marginFraction: "0.2"
    41                  lowAmplitudeThreshold: "1.0"
    42                  highFrequencyThreshold: "0.05"
    43                  minNumOfSpectrumItems: 10
    44                  maxNumOfSpectrumItems: 20