Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement(spd): set default baselint ratio by qos level #375

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

cheney-lin
Copy link
Member

What type of PR is this?

Enhancements

What this PR does / why we need it:

Which issue(s) this PR fixes:

Special notes for your reviewer:

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (c7f2e91) 53.36% compared to head (0e9f12e) 53.42%.
Report is 1 commits behind head on main.

Files Patch % Lines
pkg/controller/spd/spd.go 60.00% 6 Missing and 2 partials ⚠️
pkg/util/native/object.go 50.00% 3 Missing and 3 partials ⚠️
pkg/controller/spd/indicator-plugin/manager.go 75.00% 3 Missing and 1 partial ⚠️
cmd/katalyst-controller/app/options/spd.go 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #375      +/-   ##
==========================================
+ Coverage   53.36%   53.42%   +0.05%     
==========================================
  Files         439      439              
  Lines       48322    48372      +50     
==========================================
+ Hits        25789    25842      +53     
+ Misses      19622    19611      -11     
- Partials     2911     2919       +8     
Flag Coverage Δ
unittest 53.42% <66.10%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cheney-lin cheney-lin self-assigned this Nov 22, 2023
@cheney-lin cheney-lin added enhancement New feature or request workflow/need-review review: test succeeded, need to review labels Nov 22, 2023
// for indicator get functions, IndicatorUpdater will return a channel to obtain the merged results.
GetIndicatorSpec(_ types.NamespacedName) *apiworkload.ServiceProfileDescriptorSpec
GetIndicatorStatus(_ types.NamespacedName) *apiworkload.ServiceProfileDescriptorStatus
GetSPDSpec(_ types.NamespacedName) *apiworkload.ServiceProfileDescriptorSpec
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it's better to keep GetIndicatorSpec, since the logic is for updating indicator spec (despite that the returned value is entire spec for spd)

@@ -539,6 +542,25 @@ func (sc *SPDController) getWorkload(gvr schema.GroupVersionResource, namespace,
return workload, nil
}

func (sc *SPDController) defaultBaselineRatio(workload *unstructured.Unstructured) *float32 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for safety reasons, the default value when error appears should be 100 rather than nil (which actually equals 0)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and remember to add some comments for why we should return 100

@@ -39,6 +40,8 @@ type IndicatorUpdater interface {
AddBusinessIndicatorSpec(_ types.NamespacedName, _ []apiworkload.ServiceBusinessIndicatorSpec)
AddSystemIndicatorSpec(_ types.NamespacedName, _ []apiworkload.ServiceSystemIndicatorSpec)
AddBusinessIndicatorStatus(_ types.NamespacedName, _ []apiworkload.ServiceBusinessIndicatorStatus)

UpdateBaselineRatio(_ types.NamespacedName, _ float32)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make the naming aligned, either by change the origin AddBusinessIndicatorSpec to Updatexxx or UpdateBaselineRatio to AddBaselineRatio

@cheney-lin cheney-lin force-pushed the dev/spd branch 5 times, most recently from 8a2c251 to 85ecf34 Compare November 23, 2023 03:40
Signed-off-by: linzhecheng <linzhecheng@bytedance.com>
@cheney-lin cheney-lin added workflow/merge-ready merge-ready: code is ready and can be merged and removed workflow/need-review review: test succeeded, need to review labels Nov 23, 2023
@waynepeking348 waynepeking348 merged commit a310c49 into kubewharf:main Nov 23, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request workflow/merge-ready merge-ready: code is ready and can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants