Skip to content

Commit

Permalink
Merge pull request #91 from cheney-lin/dev/cpuprovision
Browse files Browse the repository at this point in the history
chore: refine control knob constraints
  • Loading branch information
luomingmeng authored Jul 2, 2024
2 parents cd483b8 + b2782c0 commit be552fd
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,30 +82,26 @@ spec:
constraints:
items:
properties:
name:
description: ControlKnobName defines available
control knob key for provision policy
type: string
restrictControlKnobMaxLowerGap:
description: RestrictControlKnobMaxUpperGap
is the maximum downward offset value from
the baseline
maxLowerGap:
description: MaxLowerGap is the maximum downward
offset value from the baseline
type: number
restrictControlKnobMaxLowerGapRatio:
description: RestrictControlKnobMaxUpperGap
is the maximum downward offset ratio from
the baseline
maxLowerGapRatio:
description: MaxLowerGapRatio is the maximum
downward offset ratio from the baseline
type: number
restrictControlKnobMaxUpperGap:
description: RestrictControlKnobMaxUpperGap
is the maximum upward offset value from the
baseline
maxUpperGap:
description: MaxUpperGap is the maximum upward
offset value from the baseline
type: number
restrictControlKnobMaxUpperGapRatio:
description: RestrictControlKnobMaxUpperGap
is the maximum upward offset ratio from the
baseline
maxUpperGapRatio:
description: MaxUpperGapRatio is the maximum
upward offset ratio from the baseline
type: number
name:
description: ControlKnobName defines available
control knob key for provision policy
type: string
required:
- name
type: object
Expand Down
22 changes: 13 additions & 9 deletions pkg/apis/config/v1alpha1/adminqos.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,20 @@ type IndicatorTargetConfiguration struct {
Target float64 `json:"target"`
}

type RestrictConstraints struct {
// MaxUpperGap is the maximum upward offset value from the baseline
MaxUpperGap *float64 `json:"maxUpperGap,omitempty"`
// MaxLowerGap is the maximum downward offset value from the baseline
MaxLowerGap *float64 `json:"maxLowerGap,omitempty"`
// MaxUpperGapRatio is the maximum upward offset ratio from the baseline
MaxUpperGapRatio *float64 `json:"maxUpperGapRatio,omitempty"`
// MaxLowerGapRatio is the maximum downward offset ratio from the baseline
MaxLowerGapRatio *float64 `json:"maxLowerGapRatio,omitempty"`
}

type ControlKnobConstraints struct {
Name ControlKnobName `json:"name"`
// RestrictControlKnobMaxUpperGap is the maximum upward offset value from the baseline
RestrictControlKnobMaxUpperGap *float64 `json:"restrictControlKnobMaxUpperGap,omitempty"`
// RestrictControlKnobMaxUpperGap is the maximum downward offset value from the baseline
RestrictControlKnobMaxLowerGap *float64 `json:"restrictControlKnobMaxLowerGap,omitempty"`
// RestrictControlKnobMaxUpperGap is the maximum upward offset ratio from the baseline
RestrictControlKnobMaxUpperGapRatio *float64 `json:"restrictControlKnobMaxUpperGapRatio,omitempty"`
// RestrictControlKnobMaxUpperGap is the maximum downward offset ratio from the baseline
RestrictControlKnobMaxLowerGapRatio *float64 `json:"restrictControlKnobMaxLowerGapRatio,omitempty"`
Name ControlKnobName `json:"name"`
RestrictConstraints RestrictConstraints `json:",inline"`
}

type CPUProvisionConfig struct {
Expand Down
57 changes: 37 additions & 20 deletions pkg/apis/config/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit be552fd

Please sign in to comment.