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
Bug 1873192: show empty state in monitoring when no datapoint available #6463
Bug 1873192: show empty state in monitoring when no datapoint available #6463
Conversation
@nemesis09: This pull request references Bugzilla bug 1873192, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@nemesis09: This pull request references Bugzilla bug 1873192, which is valid. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -673,11 +676,12 @@ const QueryBrowser_: React.FC<QueryBrowserProps> = ({ | |||
setXDomain([from, to]); | |||
setSpan(to - from); | |||
}; | |||
const isGraphDataEmpty = _.isEmpty(_.flattenDeep(graphData)); |
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 think we should avoid using _.flattenDeep
because there can be a large amount of data in graphData
and we already have performance concerns.
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
const isGraphDataEmpty = _.isEmpty(graphData) || _.every(graphData, (d) => d.length === 0);
or
const isGraphDataEmpty = !_.some(graphData, (d) => d.length > 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.
we could use const isGraphDataEmpty = !graphData || graphData.every((d) => d.length === 0)
since every()
always returns true for any condition when array is empty, we could drop the check _.isEmpty
updated the checks. please take a look.
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.
👍 Thanks
@@ -501,6 +501,9 @@ const QueryBrowser_: React.FC<QueryBrowserProps> = ({ | |||
tickInterval, | |||
timespan, | |||
}) => { | |||
// Min height for GraphEmpty(empty state) | |||
const EMPTY_GRAPH_MIN_HEIGHT = 310; |
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.
Do we need this? I think the height should still be reasonable without it. We already have a state where an error message is displayed without a graph and I think the height is OK in that case without forcing a height
.
Is there a page that looks bad without EMPTY_GRAPH_MIN_HEIGHT
?
Also, I notice that 310
is too much for some places, like the Admin perspective > Monitoring > Metrics page.
Ideally, we wouldn't use EMPTY_GRAPH_MIN_HEIGHT
and just fallback to CSS to give a reasonable height.
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.
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.
One problem with this is that depending on the page, the graph-empty-state
wrapper may contain other content in addition to the empty state message (like the graph controls on the Metrics page), so the 310px
actually makes the graph-empty-state
taller than 310 pixels.
Not sure if there is an easy CSS fix here.
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.
If we don't want to set the height then we can do it by using display: table
CSS property. WDYT @kyoto?
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.
^ @christianvogt What will be the better way to fix this?
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.
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.
Looks like the styling needs to be applied more conditionally since it's only necessary when the empty state is shown
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.
added conditional styling @kyoto
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.
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've pushed a fix addressing the css issue. Please take a look
a6d69ef
to
992e670
Compare
/retest |
@nemesis09: This pull request references Bugzilla bug 1873192, which is valid. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
f176c8b
to
cc32b9b
Compare
/retest |
cc32b9b
to
e4fa3f9
Compare
I tested and didn't see any layout issues with this now. Thanks @nemesis09! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kyoto, nemesis09 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 |
@nemesis09: All pull requests linked via external trackers have merged: Bugzilla bug 1873192 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fixes:
https://issues.redhat.com/browse/ODC-4469
https://issues.redhat.com/browse/ODC-3297
Analysis / Root cause:
the monitoring tab shows empty charts when there are no datapoints available
Solution Description:
show empty state when there are no datapoints
Screens:
Before
After
Test Coverage:
NA
Browser Conformance: