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 additional metrics to PVC Page #5763

Merged
merged 1 commit into from Jul 2, 2020

Conversation

bipuladh
Copy link
Contributor

@bipuladh bipuladh commented Jun 17, 2020

Introduces Donut Chart in Details Page
Introduces Used Capacity in List Page
Moving PVC Metrics from Mi/Gi/Ti to MiB/GiB/TiB
Screenshot from 2020-07-01 16-37-04
Screenshot from 2020-06-17 20-09-28
Adding missing items from https://issues.redhat.com/browse/KNIP-638

@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/core Related to console core functionality labels Jun 17, 2020
@bipuladh bipuladh force-pushed the pvc_updates branch 2 times, most recently from 7b9db50 to a44ae1b Compare June 17, 2020 15:42
@openshift-ci-robot openshift-ci-robot added the component/shared Related to console-shared label Jun 17, 2020
@bipuladh bipuladh force-pushed the pvc_updates branch 2 times, most recently from 079c726 to ed1e4d3 Compare June 17, 2020 15:59
@bipuladh bipuladh changed the title [WIP] Add additional metrics to PVC Page Add additional metrics to PVC Page Jun 17, 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 Jun 17, 2020
Comment on lines +42 to +43
const query = _.template('kubelet_volume_stats_used_bytes${name}');
return name ? query({ name: `{persistentvolumeclaim='${name}'}` }) : query();
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 please review this query. Thanks.

@bipuladh
Copy link
Contributor Author

@openshift/team-ux-review adding some metrics for PVC based on an old story. PTAL.

@bipuladh
Copy link
Contributor Author

/assign @TheRealJon
cc @yuvalgalanti

Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

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

Got a runtime error when creating a new PVC:

image

Screen Shot 2020-06-18 at 3 49 19 PM

@bipuladh
Copy link
Contributor Author

bipuladh commented Jun 19, 2020

Got a runtime error when creating a new PVC:

image

Screen Shot 2020-06-18 at 3 49 19 PM

Oops! changed variable name and dint update it. My bad.

@TheRealJon
Copy link
Member

Donut grows to fill entire available horizontal space:

image

@yuvalgalanti
Copy link

the designs you shared looks great @bipuladh. I think I need to sync up with the OCP team next week to see if they are ok with that. I think the behavior should be that in large screens we are showing it like that and in small screens, the donut chart will be above the content on the left side. we have a meeting next week with the OCP team so we can sync there.

Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

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

A few changes needed. Let me know if you have questions, I know there's a lot of comments.

// @ts-ignore
import { useDispatch } from 'react-redux';
import { sortable } from '@patternfly/react-table';
import { ChartDonut } from '@patternfly/react-charts';
Copy link
Member

Choose a reason for hiding this comment

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

So, we have a collection of prometheus driven graphs in frontend/public/components/graphs. There is currently no donut chart defined there, but I feel like this would be a good time to create one and use it here. That way it will be reusable if future components need to use a donut chart. There is a gauge component there that is essentially a special donut case, so you could use that component as a starting point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can take it as a follow-up PR.

frontend/public/components/_persistent-volume-claim.scss Outdated Show resolved Hide resolved
frontend/public/components/persistent-volume-claim.jsx Outdated Show resolved Hide resolved
frontend/public/components/persistent-volume-claim.jsx Outdated Show resolved Hide resolved
frontend/public/components/persistent-volume-claim.jsx Outdated Show resolved Hide resolved
frontend/public/components/persistent-volume-claim.jsx Outdated Show resolved Hide resolved
frontend/public/components/persistent-volume-claim.jsx Outdated Show resolved Hide resolved
frontend/public/actions/ui.ts Show resolved Hide resolved
@TheRealJon
Copy link
Member

Also, I am still seeing the issue with the chart size increasing to fill the entire space on the right.

@TheRealJon
Copy link
Member

@bipuladh After some thought, I don't know that we should conditionally run that prometheus poll based on screen width. I think a solution that works well would be more complex than it's worth for a minor performance gain. @spadgett thoughts?

@bipuladh
Copy link
Contributor Author

@bipuladh After some thought, I don't know that we should conditionally run that prometheus poll based on screen width. I think a solution that works well would be more complex than it's worth for a minor performance gain. @spadgett thoughts?

@TheRealJon do we really need to listen to the window's size? I don't think a user would resize their window IMO. The current approach I have taken only runs the poll if the initial width is greater than a certain threshold. If she later increases the size of the window then she would have to refresh.

@TheRealJon
Copy link
Member

TheRealJon commented Jun 25, 2020

@TheRealJon do we really need to listen to the window's size? I don't think a user would resize their window IMO. The current approach I have taken only runs the poll if the initial width is greater than a certain threshold. If she later increases the size of the window then she would have to refresh.

That's fair, I think it would definitely be an edge case, but what if initial width is smaller than 1450, then the window gets maximized, put in full screen, or moved to another display with a larger resolution? Then the used capacity column would be shown, and no data would ever populate unless they refresh.

@bipuladh
Copy link
Contributor Author

Also, I am still seeing the issue with the chart size increasing to fill the entire space on the right.

@TheRealJon I cannot reproduce it on my setup are you sure you have the latest commit?

@bipuladh bipuladh force-pushed the pvc_updates branch 2 times, most recently from 7facd71 to 985df15 Compare July 1, 2020 11:09
Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

This isn't a new problem, but when adding the "GiB" units inside the donut, it becomes really crowded. I think that if we had a triple digit value, it would probably overflow. After some discussion, I think the fix might be outside the scope of this PR, since it is one of many consistency problems we've had with donuts. IMO, we probably need to create a common component to apply consistent styling and usage.
Created https://issues.redhat.com/browse/CONSOLE-2305 to track.

Also, minor nit that could be fixed in a follow-on: There should probably be a 20px margin below the donut chart to match the margin below the heading.

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

/lgtm

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

spadgett commented Jul 2, 2020

/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 2, 2020
Introduces Donut Chart in Details Page
Introduces Used Capacity in List Page
Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bipuladh, spadgett, TheRealJon

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.

@bipuladh
Copy link
Contributor Author

bipuladh commented Jul 2, 2020

/retest

@openshift-merge-robot openshift-merge-robot merged commit c925faa into openshift:master Jul 2, 2020
@spadgett spadgett added this to the v4.6 milestone Jul 8, 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/core Related to console core functionality 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

7 participants