-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
feat(ui): Requests info for Cpu and Mem added to Pod details #20637
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Surajyadav <[email protected]>
🔴 Preview Environment stopped on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
Signed-off-by: Surajyadav <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #20637 +/- ##
=========================================
Coverage ? 55.16%
=========================================
Files ? 324
Lines ? 55203
Branches ? 0
=========================================
Hits ? 30451
Misses ? 22143
Partials ? 2609 ☔ View full report in Codecov by Sentry. |
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.
LGMT, have some minor comments
case 'Requests (CPU)': | ||
return `${numericValue}m`; | ||
case 'Requests (MEM)': { | ||
return formatSize(numericValue / 1000); |
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.
Should this be / 1024?
@@ -388,6 +410,29 @@ function formatMetric(name: ResourceName, val: number) { | |||
return (val || '0') + 'm'; | |||
} | |||
|
|||
function claculatePodGrouprResquests(pods: Pod[]) { |
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.
Typos: claculatePodGrouprResquests -> calculatePodGroupsRequests
const numericValue = parseInt(info.value, 10); //convert the string value to number | ||
totalCpuMillicores += numericValue; | ||
} | ||
if (info.name === 'Requests (MEM)') { |
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.
Let's use constants for these.
|
||
return { | ||
cpuRequest: `${totalCpuMillicores}m`, | ||
memoryRequests: `${formatSize(totalMemory / 1000)}` //changing it to bytes for formatSize |
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.
Maybe / 1024
Resolves issue: #19457
1. Added the pod requests info to the Pod tooltip.
This will only show if the pod currently has some reserved requests (running pods with allocated requests).
When the pod completes successfully or fails with an error, the requests will be shown as 0 since they are no longer reserved.
(also if the resources aren't declared )
2. For the original request of adding the top/parent resource groups,
Added tests in info.go f and utils.test for scenerios of completed and failed state with allocated resources.
whole-pod-view-test.mp4
Checklist: