-
Notifications
You must be signed in to change notification settings - Fork 121
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
Render reported before complete #2124
Comments
Related to changes in #1730 |
As commented here #1730 (comment)
We changed that mechanism to give the consumer the control over how to handle that call, but we can probably go back, at least for the |
@drewdaemon in the meantime can you check this works on lens side, by creating something like that:
|
Thanks @markov00 . This does resolve the issue.
I'm in favor of this. It would be nice to have a fix here in the charts library, since we otherwise have to remember to add this to every expression renderer. |
@nickofthyme what do you think about bringing back the RAF only for the |
Yeah I think that's the best solution, I don't see another way to fix it. |
## Summary This PR instruments the code to track a few key editor performance metrics. This is to prepare for adding a Lens editor performance journey. Metrics - initial load of main chart - time to load data - time to render - time to initially load and render all suggestions For this PR, each metric is reported to the console (commented out to pass the linter). When the journey is added, the console statements will be converted to analytics service calls so that they show up as metrics in the journey dashboard. I made a few changes to increase the accuracy of the metrics. - wrapping render-complete callbacks in `requestAnimationFrame` calls as a temporary solution to elastic/elastic-charts#2124 - fixing a multiple-subscription issue in the workspace panel --------- Co-authored-by: Stratoula Kalafateli <[email protected]>
## Summary This PR instruments the code to track a few key editor performance metrics. This is to prepare for adding a Lens editor performance journey. Metrics - initial load of main chart - time to load data - time to render - time to initially load and render all suggestions For this PR, each metric is reported to the console (commented out to pass the linter). When the journey is added, the console statements will be converted to analytics service calls so that they show up as metrics in the journey dashboard. I made a few changes to increase the accuracy of the metrics. - wrapping render-complete callbacks in `requestAnimationFrame` calls as a temporary solution to elastic/elastic-charts#2124 - fixing a multiple-subscription issue in the workspace panel --------- Co-authored-by: Stratoula Kalafateli <[email protected]>
Describe the issue
The library is reporting a complete render one tick too early.
To Reproduce
Add a breakpoint or log statement to the body of the
onRenderChange
callback for a chart.Expected behaviour
onRenderChange
should only be called withtrue
when the chart has been rendered to the canvas. Instead, it is being called a tick before the chart is drawn.Screenshots
Screen.Recording.2023-08-02.at.10.14.03.AM.mov
Look for "visualization took to render after data received" in the above recording ^^. It is logged before the chart is visible.
Version (please complete the following information):
Additional context
This behavior throws off our performance measurements, making it look like we're rendering the chart faster than we actually are.
The problem may originate with this change.
Errors in browser console
None
The text was updated successfully, but these errors were encountered: