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

Optimize event handler performance for PodUnavailableBudget #1027

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

FillZpp
Copy link
Member

@FillZpp FillZpp commented Jul 16, 2022

Signed-off-by: FillZpp FillZpp.pub@gmail.com

Ⅰ. Describe what this PR does

Optimize event handler performance for PodUnavailableBudget.

@kruise-bot kruise-bot requested review from Fei-Guo and furykerry July 16, 2022 07:46
@kruise-bot kruise-bot added the size/S size/S 10-29 label Jul 16, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2022

Codecov Report

Merging #1027 (432725f) into master (58713b5) will increase coverage by 0.00%.
The diff coverage is 42.85%.

@@           Coverage Diff           @@
##           master    #1027   +/-   ##
=======================================
  Coverage   49.67%   49.67%           
=======================================
  Files         124      124           
  Lines       12088    12090    +2     
=======================================
+ Hits         6005     6006    +1     
- Misses       5165     5167    +2     
+ Partials      918      917    -1     
Flag Coverage Δ
unittests 49.67% <42.85%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
pkg/control/pubcontrol/pub_control_utils.go 51.78% <ø> (ø)
...tentpodstate/persistent_pod_state_event_handler.go 0.00% <0.00%> (ø)
...g/webhook/pod/validating/pod_unavailable_budget.go 64.17% <50.00%> (-0.91%) ⬇️
...ller/podunavailablebudget/pub_pod_event_handler.go 27.34% <100.00%> (+1.18%) ⬆️
pkg/controller/daemonset/daemonset_update.go 54.86% <0.00%> (-0.89%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58713b5...432725f. Read the comment docs.

@FillZpp FillZpp force-pushed the optimize-code branch 3 times, most recently from 774f788 to 432725f Compare July 16, 2022 08:54
pps := p.fetchPersistentPodState(newPod)
if pps == nil {
return
}
if !isPodValidChanged(oldPod, newPod) {
Copy link
Member

Choose a reason for hiding this comment

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

why change the ordering?

Signed-off-by: FillZpp <FillZpp.pub@gmail.com>
Copy link
Member

@furykerry furykerry left a comment

Choose a reason for hiding this comment

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

/lgtm

@FillZpp
Copy link
Member Author

FillZpp commented Jul 18, 2022

/approve

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FillZpp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kruise-bot kruise-bot merged commit 201eedc into openkruise:master Jul 18, 2022
@FillZpp FillZpp added this to the v1.3.0 milestone Jul 21, 2022
diannaowa pushed a commit to diannaowa/kruise that referenced this pull request Sep 14, 2022
…se#1027)

Signed-off-by: FillZpp <FillZpp.pub@gmail.com>
Signed-off-by: Liu Zhenwei <zwliu@thoughtworks.com>
ppbits pushed a commit to ppbits/kruise that referenced this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants