-
Notifications
You must be signed in to change notification settings - Fork 49
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: Update cpu and memory charts on namespace #3711
base: main
Are you sure you want to change the base?
feat: Update cpu and memory charts on namespace #3711
Conversation
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.
Partial review
return podsMetrics.reduce((accData, pod) => { | ||
return { | ||
cpu: { | ||
usage: accData.cpu.usage + (pod?.cpu?.usage ?? 0), |
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.
I would consider to wrap all addition by getCpus
or getBytes
functions because sometimes k8s can return values with different prefix.
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.
<React.Fragment key="resource-quota-limits"> | ||
{(!!podsMetrics?.length || !isEmpty(resource?.status)) && ( | ||
<div className="cluster-stats sap-margin-tiny"> | ||
{mapUsagesToChartsData(podsMetrics).map((chartData, index) => ( |
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.
What do you think about merging those 2 tables before rendering happen and then render it?
It would remove duplication of code.
} as UseGetOptions) as { data: NodeList | null }; | ||
|
||
// Finding capacity for a given usage. | ||
const getAllocatable = ( |
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.
It can be move as separate function. It's very long and it's inside function
> | ||
{scope.scopeName} | ||
</Title> | ||
(resource: ResourceQuotaProps) => ( |
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.
Would you like to rename ResourceQuotaProps
to ResourceQuota
because this type looks like k8s ResourceQuota
cy.contains('Events') | ||
.scrollIntoView() | ||
.should('be.visible'); | ||
}); | ||
|
||
it('checks the visibility of charts', () => { |
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.
Why this test checks errors and loading?
I think it should check if charts are available and visible.
Description
Changes proposed in this pull request:
Related issue(s)
Closes #3592
Definition of done
backlog#4567