-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[TSVB] Show the loading spinner while loading in dashboard #114244
Conversation
Pinging @elastic/kibana-vis-editors (Team:VisEditors) |
@elasticmachine merge upstream |
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 looked at the loading behavior by creating a dashboard, going to the listing page, reloading, then delaying each request by 5s and loading the dashboard. This is what happens in order (omitted irrelevant parts but we should really work on avoiding dependent requests... separate story though):
- 1 loading visualization embeddable (dashboard shows a spinner for this time)
- 2 loading TSVB data (no spinner shown during this time)
- 3 loading some other async TSVB chunks (no spinner shown during this time)
- 4 loading the vis component (spinner shown)
- 5 chart shown
I think to cover 3 we need to add the loading fallback here as well - something we could do on this PR as well (or maybe we can collapse the async chunks here into a single one? didn't check it though):
<TimeseriesVisualization |
To cover 2, we probably need to move one layer up and render the loading icon once here (other charts will profit as well):
kibana/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts
Lines 305 to 306 in 5f994b1
super.render(this.domNode); | |
Then let the expression loader take over the dom node once it's ready
@@ -90,7 +90,9 @@ describe('metric_expression', () => { | |||
reportDescription="Fancy chart description" | |||
reportTitle="My fanci metric chart" | |||
> | |||
<AutoScale> |
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.
Seems like the Lens changes ended up in here on accident, do you want to remove them?
But there's already one there: the |
@elasticmachine merge upstream |
Hm, right, maybe it's the scss import which isn't "suspended"?
Would it make sense to move it one layer deeper? |
It seems that fixed it 👍 |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
I've recorded the timings and various phases of the loading (also added a loader fallback for the case you've pointed), but it looks like the biggest gap happens between the Here's a static picture of the logs with some annotations: Some of those waiting are due to expression data loading upfront, which I suspect they are deferred in the Lens embeddable, for instance, is that right? The point you want to address is the following, which is relatively fast (few ms on a throttled connection): {now: 1634575325649, status: '[timeseries_vis_renderer.tsx] Loading', type: 'timeseries'}
{now: 1634575325651, status: '[timeseries_vis_renderer.tsx] Loaded', type: 'timeseries'} |
It would be this place, right? kibana/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts Lines 305 to 306 in 5f994b1
Could we have spinner there as well? I think it’s worth solving this for all layers, there shouldn’t be so much jumping around when loading the page. |
<TimeseriesVisualization | ||
// it is mandatory to bind uiSettings because of "this" usage inside "get" method | ||
getConfig={uiSettings.get.bind(uiSettings)} | ||
render( |
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.
should it be unmounted here before render the proper one?
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'm not sure how important it is, but it should be fairly easy to unmount correctly - just call ReactDOM. unmountComponentAtNode(element)
in these places.
@flash1293 do you think it's worth adding 6kb to the |
Ok, from the previous message I thought it was only a 6kb change, but 98kb it's another story. Will resolve it 😅 |
Reversed last commit with the async chunk removal. Will track the issue in another PR. |
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
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.
Works perfectly, thanks. Left a comment about unmounting the various loading spinners
<TimeseriesVisualization | ||
// it is mandatory to bind uiSettings because of "this" usage inside "get" method | ||
getConfig={uiSettings.get.bind(uiSettings)} | ||
render( |
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'm not sure how important it is, but it should be fairly easy to unmount correctly - just call ReactDOM. unmountComponentAtNode(element)
in these places.
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
…14244) * 🐛 Fix metric rescale * 📸 Restored old snapshots * 🐛 Extend the fix to all scenarios * 📸 Refresh snapshots for new fix * 💄 Add suspense with loading spinner while waiting for the component to be loaded * 🐛 Move the styling one level deeper to avoid loading gaps * 🐛 show loader since the beginning and speed up a bit embeddable load * 💄 Show the loader while waiting for the palette * ⚡ Remove one chunk from TSVB async series * 🐛 Restore previous async chunk * 👌 Integrate feedback * 🚨 Fix linting issue Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…116122) * 🐛 Fix metric rescale * 📸 Restored old snapshots * 🐛 Extend the fix to all scenarios * 📸 Refresh snapshots for new fix * 💄 Add suspense with loading spinner while waiting for the component to be loaded * 🐛 Move the styling one level deeper to avoid loading gaps * 🐛 show loader since the beginning and speed up a bit embeddable load * 💄 Show the loader while waiting for the palette * ⚡ Remove one chunk from TSVB async series * 🐛 Restore previous async chunk * 👌 Integrate feedback * 🚨 Fix linting issue Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
Summary
Fixes #105678
I think this is a partial fix for the related issue as it shows a Loading animation while loading the timeseries component.
Couldn't manage to find out where is the component which is missing the other Loading animation in the process: notice the initial time window, before the Gauge loads where the time series has no animation yet.
With the fix (I've exaggerated the loading time for time series to 10s to better record it):
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers