-
Notifications
You must be signed in to change notification settings - Fork 757
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
Make capping happen after scale of the CPU usage in ResourceUtilization #5388
Conversation
@dotnet-policy-service agree company="Microsoft" |
@Weikai1997 thanks for taking care of this. Could you please also add one or more tests such that they were failing before but won't be failing with your fix? |
@evgenyfedorov2 test added |
test/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests/CalculatorTests.cs
Outdated
Show resolved
Hide resolved
test/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests/CalculatorTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/Calculator.cs
Outdated
Show resolved
Hide resolved
test/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests/CalculatorTests.cs
Outdated
Show resolved
Hide resolved
test/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests/CalculatorTests.cs
Outdated
Show resolved
Hide resolved
@Weikai1997 thanks for the submission. |
@RussKie Updated the PR title and the first post. Please tell me if more details need to add. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
test/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests/CalculatorTests.cs
Outdated
Show resolved
Hide resolved
We'll merge once the changes are validated and confirmed to have addressed the issue. |
The change was successfully verified. |
Fixes: #5387
The range of cpuUtilization we calculated from Snapshot in the Calculator is [0, 100*request]. We shouldn't capping the value to 100 in this step.
Instead, we should have the capping after we scale the utilization value to [0,100] by divide GuaranteedCpuUnits in the ResourceUtilization constructor.
Microsoft Reviewers: Open in CodeFlow