Skip to content

Conversation

@h-w-chen
Copy link
Collaborator

@h-w-chen h-w-chen commented Nov 28, 2025

What type of PR is this?

Features

What this PR does / why we need it:

This PR allows power-ware plugin to enable reclaimed cpu headroom discount when the node's power level is of p1/p2/p3.

To ensure the power-aware plugin enabling to happen prior qos-aware cpu resource advisor being called to GetHeadroom, Init phase is put with cpu sub resource advisor up to qos-aware plugin.

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 53.84615% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.05%. Comparing base (798dc28) to head (1f97144).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
.../headroomassembler/decorator/decorator_discount.go 57.62% 21 Missing and 4 partials ⚠️
...assembler/headroomassembler/decorator/decorator.go 35.29% 11 Missing ⚠️
...sor/plugin/qosaware/resource/cpu/advisor_helper.go 30.00% 6 Missing and 1 partial ⚠️
...ptions/sysadvisor/poweraware/power_aware_plugin.go 69.23% 4 Missing ⚠️
...sadvisor/plugin/qosaware/resource/resource_stub.go 0.00% 4 Missing ⚠️
.../agent/sysadvisor/plugin/poweraware/power_aware.go 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1034      +/-   ##
==========================================
+ Coverage   59.86%   60.05%   +0.18%     
==========================================
  Files         689      692       +3     
  Lines       65082    65230     +148     
==========================================
+ Hits        38964    39173     +209     
+ Misses      21657    21602      -55     
+ Partials     4461     4455       -6     
Flag Coverage Δ
unittest 60.05% <53.84%> (+0.18%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@h-w-chen h-w-chen force-pushed the dev/pap-discounted-cpu-headroom branch 2 times, most recently from 8474476 to abe7d94 Compare December 1, 2025 23:42
@h-w-chen h-w-chen force-pushed the dev/pap-discounted-cpu-headroom branch 2 times, most recently from 1f97144 to cf4b24d Compare December 2, 2025 19:31
@h-w-chen h-w-chen changed the title WIP: pap: cpu headrrom discount feat(advisor): apply cpu headrrom discount when power level is present Dec 2, 2025
@h-w-chen h-w-chen added the workflow/need-review review: test succeeded, need to review label Dec 2, 2025
@h-w-chen h-w-chen changed the title feat(advisor): apply cpu headrrom discount when power level is present feat(advisor): apply cpu headroom discount when power level is present Dec 2, 2025
numaHeadrooms[numa] = applyDiscount(numaHeadrooms[numa], currentDiscount)
}
if err != nil || currentDiscount >= 1.0 {
return headroom, numaHeadrooms, err
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this error need to be encapsulated? When err is empty and currentDiscount>=1.0, is it expected that err will be empty?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

workflow/need-review review: test succeeded, need to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants