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

Add RGW Support in Object Service Dashboard #6070

Merged
merged 1 commit into from Jul 29, 2020

Conversation

bipuladh
Copy link
Contributor

@bipuladh bipuladh commented Jul 22, 2020

Add Support for RGW in Top Consumers Card
Add Support for Performance Card
Added Dashboard upgrade for RGW
Screenshot from 2020-07-27 15-27-14
Screenshot from 2020-07-27 15-26-55
Screenshot from 2020-07-27 15-26-43

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. component/ceph Related to ceph-storage-plugin labels Jul 22, 2020
@openshift-ci-robot openshift-ci-robot added component/core Related to console core functionality component/dashboard Related to dashboard component/noobaa Related to noobaa-storage-plugin component/shared Related to console-shared labels Jul 22, 2020
@bipuladh bipuladh changed the title [WIP] Add Health Status Popovers for Status Card for RGW [WIP] Add RGW Support in Object Service Dashboard Jul 22, 2020
@bipuladh bipuladh force-pushed the rgw_work branch 4 times, most recently from 5753225 to 20ab6fe Compare July 22, 2020 22:43
curentDropdown,
const parser = React.useMemo(
() =>
// Todo (bipuladh): Fix data consumption utils to work with getInstantVectorStats
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Won't be doing as part of 4.6.

setSelectedBreakdown={setBreakdownBy}
selectedMetric={metric}
setSelectedMetric={setMetric}
isRgwSupported
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anmolsachan we need to determine where we are going to support it and where not.

@bipuladh bipuladh changed the title [WIP] Add RGW Support in Object Service Dashboard Add RGW Support in Object Service Dashboard Jul 22, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 22, 2020
name: _.truncate(`${r.x}`, { length: 12 }),
link: `${r.x}`,
color: Colors.LINK,
name: labelNames ? labelNames[i] : _.truncate(`${r.x}`, { length: 12 }),
Copy link
Contributor

Choose a reason for hiding this comment

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

A question here - Shouldn't you be checking labelNames[i] too here, before applying it in case labelNames[i] is undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need as there a few cases where we pass label names and for those cases, we can put the correct number of items, in the array. I have created a map for those special cases.


return results;
};

type UsePrometheusQuery = (query: string, humanize: Humanize) => [HumanizeResult, any, number];
type UsePrometheusQueries = (queries: string[], metric?: string) => UsePrometheusQueriesResult;
type UsePrometheusQueriesResult = [DataPoint[], boolean, any][];
// [data, loading, loadError]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this comment here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To make people aware of difference between loading and loaded. I see some interfaces using loading and some using loaded.

queryKeys.forEach((q) => stopWatchPrometheusQuery(queries[q]));
};
}, [watchPrometheus, stopWatchPrometheusQuery, metricType, queryKeys, queries]);
const getDisablableSelectOptions = (dropdownItems: DropdownItems) => {
Copy link
Contributor

@gnehapk gnehapk Jul 23, 2020

Choose a reason for hiding this comment

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

typo getDisableableSelectOptions

selections={[serviceType]}
isGrouped
placeholderText={`Type: ${serviceType}`}
isCheckboxSelectionBadgeHidden
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add id

isOpen={isOpenBreakdownSelect}
selections={[metricType]}
isGrouped
placeholderText={`By: ${serviceType}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add id

setSelectedBreakdown={setBreakdownBy}
selectedMetric={metric}
setSelectedMetric={setMetric}
isRgwSupported
Copy link
Contributor

Choose a reason for hiding this comment

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

isRgwSupported -> isRGWSupported might be better

componentsHealth: SubsystemHealth[],
): { state: HealthState; message: string; count: number } => {
const withPriority = componentsHealth.map((h) => healthPriority[h.state]);
const withPriority = componentsHealth.map((h) => healthPriority?.[h.state] ?? {});
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for healthPriority?.[h.state]

Suggested change
const withPriority = componentsHealth.map((h) => healthPriority?.[h.state] ?? {});
const withPriority = componentsHealth.map((h) => healthPriority[h.state] ?? {});

componentsHealth: SubsystemHealth[],
): { state: HealthState; message: string; count: number } => {
const withPriority = componentsHealth.map((h) => healthPriority[h.state]);
const withPriority = componentsHealth.map((h) => healthPriority?.[h.state] ?? {});
const mostImportantState = Math.max(...withPriority.map(({ priority }) => priority));
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe even better and less error prone would be to make sure that healthPriority contains all Health States. Currently its lacking Loading state. Once we add it I think there's no reason to have separate healthStateMapping and healthPriority. We just include the priority into healthStateMapping directly.

export const healthStateMapping: { [key in HealthState]: PriorityHealthState } = {
  [HealthState.OK]: {
    priority: 0,
    health: HealthState.OK,
    icon: <GreenCheckCircleIcon />,
  },
  [HealthState.UNKNOWN]: {
    priority: 1,
    health: HealthState.UNKNOWN,
    icon: <GrayUnknownIcon />,
    message: 'Unknown',
  },
  [HealthState.PROGRESS]: {
    priority: 2,
    health: HealthState.PROGRESS,
    icon: <InProgressIcon />,
    message: 'Pending',
  },
  [HealthState.UPDATING]: {
    priority: 3,
    health: HealthState.UPDATING,
    icon: <BlueSyncIcon />,
    message: 'Updating',
  },
  [HealthState.WARNING]: {
    priority: 4,
    health: HealthState.WARNING,
    icon: <YellowExclamationTriangleIcon />,
    message: 'Degraded',
  },
  [HealthState.ERROR]: {
    priority: 5,
    health: HealthState.ERROR,
    icon: <RedExclamationCircleIcon />,
    message: 'Degraded',
  },
  [HealthState.LOADING]: {
    priority: 6,
    health: HealthState.LOADING,
    icon: <div className="skeleton-health" />,
  },
  [HealthState.NOT_AVAILABLE]: {
    priority: 7,
    health: HealthState.NOT_AVAILABLE,
    icon: <GrayUnknownIcon />,
    message: 'Not available',
  },
};

Can you try that ?

@mykaul
Copy link

mykaul commented Jul 23, 2020

Just looking at the screenshot - 'RADOS' is a terminology / details, we wish to expose to the customer? What's the benefit?

@cloudbehl
Copy link
Contributor

Just looking at the screenshot - 'RADOS' is a terminology / details, we wish to expose to the customer? What's the benefit?

@yuvalgalanti ^^

import { getDataConsumptionChartData, numberInWords } from './data-consumption-card-utils';
import { DATA_CONSUMPTION_QUERIES } from '../../queries';
import './data-consumption-card.scss';
import { PrometheusResponse } from '@console/internal/components/graphs';
Copy link
Contributor

Choose a reason for hiding this comment

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

This import should be moved before the relative ones.

@bipuladh
Copy link
Contributor Author

@bipuladh bipuladh force-pushed the rgw_work branch 2 times, most recently from 9d3cb12 to b604551 Compare July 27, 2020 10:03
},
};

type HealthStateMappingKeys = keyof typeof HealthState;
export type PriorityHealthState = {
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like we dont need this one anymore as its the same as HealthStateMappingValues

@rawagner
Copy link
Contributor

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 27, 2020
clearInterval(id);
}
});
id = setInterval(logicHandler, 10000);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: create variable for SECOND

Suggested change
id = setInterval(logicHandler, 10000);
id = setInterval(logicHandler, 10* SECOND);

Comment on lines 53 to 54
const provisioners = data.map((sc) => sc.provisioner);
if (provisioners.includes('openshift-storage.ceph.rook.io/bucket')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

const cephRGWProvisioner = 'openshift-storage.ceph.rook.io/bucket';
const checkRGWSCIsPresent = () => data.some((sc) => sc.provisioner === cephRGWProvisioner);

if(checkRGWSCIsPresent) { 
... 
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably use const file to define variable & checkRGWSCIsPresent in utils & can be used later for checks.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 28, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 28, 2020
@cloudbehl
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2020
    Add Support for Performance Card
    Added Dashboard upgrade for RGW
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2020
@cloudbehl
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bipuladh, cloudbehl, rawagner

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-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit c353047 into openshift:master Jul 29, 2020
@spadgett spadgett added this to the v4.6 milestone Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/ceph Related to ceph-storage-plugin component/core Related to console core functionality component/dashboard Related to dashboard component/noobaa Related to noobaa-storage-plugin component/olm Related to OLM component/shared Related to console-shared lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants