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

Make capping happen after scale of the CPU usage in ResourceUtilization #5388

Merged
merged 5 commits into from
Sep 4, 2024

Conversation

Weikai1997
Copy link
Contributor

@Weikai1997 Weikai1997 commented Aug 28, 2024

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

@Weikai1997
Copy link
Contributor Author

@dotnet-policy-service agree company="Microsoft"

@evgenyfedorov2
Copy link
Contributor

@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?

@Weikai1997
Copy link
Contributor Author

@evgenyfedorov2 test added

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

👍

@RussKie
Copy link
Member

RussKie commented Aug 29, 2024

@Weikai1997 thanks for the submission.
Could you please add more details to the commit message itself as well as to the body of the first post explaining the nature of the changes. That information will go into git history.

@RussKie RussKie added the waiting-author-feedback 📭 The author of this issue needs to respond in order for us to continue investigating this issue. label Aug 29, 2024
@dotnet-policy-service dotnet-policy-service bot removed the waiting-author-feedback 📭 The author of this issue needs to respond in order for us to continue investigating this issue. label Aug 29, 2024
@Weikai1997 Weikai1997 changed the title Fix ResourceUtilization CpuUsedPercentage calculation Make capping happen after scale of the CPU usage in ResourceUtlization Aug 29, 2024
@Weikai1997 Weikai1997 changed the title Make capping happen after scale of the CPU usage in ResourceUtlization Make capping happen after scale of the CPU usage in ResourceUtilization Aug 29, 2024
@Weikai1997
Copy link
Contributor Author

@RussKie Updated the PR title and the first post. Please tell me if more details need to add. Thanks

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

LGTM

@RussKie
Copy link
Member

RussKie commented Aug 29, 2024

We'll merge once the changes are validated and confirmed to have addressed the issue.

@RussKie RussKie added the waiting-author-feedback 📭 The author of this issue needs to respond in order for us to continue investigating this issue. label Sep 2, 2024
@RussKie
Copy link
Member

RussKie commented Sep 4, 2024

The change was successfully verified.

@RussKie RussKie merged commit dc1ba70 into dotnet:main Sep 4, 2024
6 checks passed
@RussKie RussKie removed the waiting-author-feedback 📭 The author of this issue needs to respond in order for us to continue investigating this issue. label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Microsoft.Extensions.Diagnostics.ResourceMonitoring with version >= 8.5.0 has bug on Utilization calculation
3 participants