-
Notifications
You must be signed in to change notification settings - Fork 2k
Display CPU usage in milli cores instead of nano cores for PodMetrics… #1674
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
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nmn3m The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @nmn3m! |
Hi @nmn3m. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
This ci failed seems to be caused by changes. Can you solve it first? 😄 |
pkg/storage/types_test.go
Outdated
last: newMetricsPoint(start, start.Add(20*time.Millisecond), 500, 600), | ||
prev: newMetricsPoint(start, start.Add(10*time.Millisecond), 300, 400), | ||
wantResourceList: v1.ResourceList{v1.ResourceCPU: uint64Quantity(uint64(20000), resource.DecimalSI, -9), | ||
wantResourceList: v1.ResourceList{v1.ResourceCPU: uint64Quantity(uint64(20000), resource.DecimalSI, -3), |
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.
Will this change affect the use of other downstream dependent parties? 🤔
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.
This change only affects the display format of CPU usage in the metrics-server output (from nano cores to milli cores). The underlying API, data structures, and values remain unchanged. This aligns with Kubernetes conventions and should not break downstream consumers, as the resource.Quantity type is still used and its string representation is now more user-friendly and consistent with other Kubernetes tools.
5a30460
to
50312d2
Compare
…/NodeMetrics This change updates the metrics-server to display CPU usage in milli cores (e.g., 67m) instead of nano cores (e.g., 67131864n) in PodMetrics and NodeMetrics outputs. - Updates the scale in resource usage calculation from -9 (nano) to -3 (milli) in pkg/storage/types.go. - Adjusts all related unit tests to expect milli core values. - Improves user experience and aligns with Kubernetes conventions, where milli cores are the standard for CPU resource display. - No API or data structure changes; only the display format is affected.
147049c
to
3cdc475
Compare
/assign /cc @slashpai |
/triage accepted |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
What this PR does / why we need it:
This PR updates metrics-server to display CPU usage in milli cores (e.g.,
67m
) instead of nano cores (e.g.,67131864n
) in PodMetrics and NodeMetrics outputs. This makes the output more intuitive and aligns with Kubernetes conventions, where milli cores are the standard for CPU resource display.Details:
pkg/storage/types.go
.Which issue(s) this PR fixes:
Fixes #1669