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

Enhance block pool mirroring status card to cover rados namespace #1666

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GowthamShanmugam
Copy link
Contributor

@GowthamShanmugam GowthamShanmugam commented Nov 8, 2024

Issue: https://issues.redhat.com/browse/RHSTOR-6578
ToDo: The overall_image_health column has to be calculated using rados image health metrics. Fetching it from the CR has some performance impact.

Issue to track metrics change: https://issues.redhat.com/browse/RHSTOR-6579

Copy link
Contributor

openshift-ci bot commented Nov 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: GowthamShanmugam

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Nov 8, 2024
Copy link
Contributor

@bipuladh bipuladh left a comment

Choose a reason for hiding this comment

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

looks good. minor comment.

packages/ocs/dashboards/block-pool/mirroring-card.tsx Outdated Show resolved Hide resolved
@GowthamShanmugam
Copy link
Contributor Author

/hold need UX approval

@GowthamShanmugam
Copy link
Contributor Author

Screenshot 2024-11-12 at 4 27 14 PM Screenshot 2024-11-12 at 4 26 52 PM

@alfonsomthd
Copy link
Collaborator

LGTM. @SanjalKatiyar & @bipuladh for tagging.

className={classNames(
'odf-block-pool__mirroring-card-item-dd',
valueClassName
!isHidden && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not hide entire MirroringCardItem on the caller's side ?? instead of hiding returned JSX.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My initial plan to hide the entire MirroringCardItem render but as per this comment, I moved the hiding part inside this component: #1666 (comment)

I am ok with both the approach

Copy link
Collaborator

Choose a reason for hiding this comment

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

what I understood from the comment is that for: !_.isEmpty(states) && isLoaded && !isLoadError, why to use "isLoaded" and "isLoadError" outside when we can pass it as a prop to MirroringCardItem, which internally handles it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

but anyway, I am okay with current changes as well...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh ok! my bad

const healthStateMap = healthStateMapping(t);
let mirroringHealth: HealthMappingValues =
healthStateMap[poolObj.status?.mirroringStatus?.summary?.health];
let imageHealth: HealthMappingValues =
Copy link
Collaborator

Choose a reason for hiding this comment

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

I saw a comment below @ToDo: Fetch aggregated image health from metrics: https://issues.redhat.com/browse/RHSTOR-6579, but here you are using CR. Which one we need to use CR or metrics ??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the last page, I want mirror image health for all block pools. If I read from CR, I will end up listening to all radio namespaces. To improve my performance I want to replace the CR read with metrics on list page.

Mirroring card under dashboard is for a specific pool, I am adding the watchers agianst the rados namespace using pool name label. Also, here I want the image state information, so I have to use CR.

t: TFunction
): HealthMappingValues[] => {
const healthStateMap = healthStateMapping(t);
let mirroringHealth: HealthMappingValues =
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here... we need to rely on CR or metrics ??

const lastChecked: string = obj.status?.mirroringStatus?.lastChecked;
const formatedDateTime = lastChecked
const [mirroringHealth, imageHealth]: HealthMappingValues[] =
aggregateMirroringHealth(obj, radosNamespaces, t);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Function is called aggregateMirroringHealth, but u r aggregating image health too... either create 2 different functions or rename current one IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mirroring_image health is a subset of mirroring health

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants