-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Lens] Add lens editor performance metrics #163089
[Lens] Add lens editor performance metrics #163089
Conversation
const onRenderHandler = useCallback(() => { | ||
setIsRenderComplete(true); | ||
onRender$(); | ||
}, [setIsRenderComplete, onRender$]); |
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.
Important to memoize—multiple subscriptions in useExpressionRenderer
hook were being created which led to multiple calls to onRender$
.
// console.log( | ||
// 'time to fetch data and perform initial render for all suggestions', | ||
// performance.now() - startTime.current | ||
// ); |
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.
uncomment for review
@@ -138,6 +138,10 @@ export const WorkspacePanel = React.memo(function WorkspacePanel(props: Workspac | |||
); | |||
}); | |||
|
|||
const log = (...messages: Array<string | number>) => { | |||
// console.log(...messages); |
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.
uncomment for review
Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations) |
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.
This looks great Drew, LGTM!
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.
Amazing work! That's a great start, thanks!
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
This is great 👍 can't wait to see the performance and set a baseline. |
## 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]>
…zation and suggestions panel (#163412) ## Summary Related to #163089 Adding the first performance journey for the Lens Editor. It simulated loading existing Lens visualisation with data view having 10k fields. We collect the following metrics: - `fetchFieldsExistenceInfo` reports time it takes to fetch fields in Data Panel - `lensVisualizationRenderTime` reports both time it takes to fetch the data (`time_to_data`) and render the main visualization (`time_to_render`) - `lensSuggestionsRenderTime` reports time it takes to render suggestions panel Metrics consistency <img width="568" alt="image" src="https://github.com/elastic/kibana/assets/10977896/3384bb8e-6152-4bae-93dc-4f7f4167ed07"> Run locally with ``` node scripts/functional_tests --config x-pack/performance/journeys/many_fields_lens_editor.ts ``` Metrics will be available here https://telemetry-v2-staging.elastic.dev/s/kibana-performance/app/dashboards#/view/dd0473ac-826f-5621-9a10-25319700326e?_g=h@61c5ac8 --------- Co-authored-by: Drew Tate <[email protected]>
…zation and suggestions panel (elastic#163412) ## Summary Related to elastic#163089 Adding the first performance journey for the Lens Editor. It simulated loading existing Lens visualisation with data view having 10k fields. We collect the following metrics: - `fetchFieldsExistenceInfo` reports time it takes to fetch fields in Data Panel - `lensVisualizationRenderTime` reports both time it takes to fetch the data (`time_to_data`) and render the main visualization (`time_to_render`) - `lensSuggestionsRenderTime` reports time it takes to render suggestions panel Metrics consistency <img width="568" alt="image" src="https://github.com/elastic/kibana/assets/10977896/3384bb8e-6152-4bae-93dc-4f7f4167ed07"> Run locally with ``` node scripts/functional_tests --config x-pack/performance/journeys/many_fields_lens_editor.ts ``` Metrics will be available here https://telemetry-v2-staging.elastic.dev/s/kibana-performance/app/dashboards#/view/dd0473ac-826f-5621-9a10-25319700326e?_g=h@61c5ac8 --------- Co-authored-by: Drew Tate <[email protected]> (cherry picked from commit 15b118c)
…visualization and suggestions panel (#163412) (#164153) # Backport This will backport the following commits from `main` to `8.10`: - [[Lens] add performance journey to track rendering time for XY visualization and suggestions panel (#163412)](#163412) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Dzmitry Lemechko","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-17T10:01:03Z","message":"[Lens] add performance journey to track rendering time for XY visualization and suggestions panel (#163412)\n\n## Summary\r\n\r\nRelated to #163089\r\n\r\nAdding the first performance journey for the Lens Editor. It simulated\r\nloading existing Lens visualisation with data view having 10k fields.\r\n\r\nWe collect the following metrics:\r\n- `fetchFieldsExistenceInfo` reports time it takes to fetch fields in\r\nData Panel\r\n- `lensVisualizationRenderTime` reports both time it takes to fetch the\r\ndata (`time_to_data`) and render the main visualization\r\n(`time_to_render`)\r\n- `lensSuggestionsRenderTime` reports time it takes to render\r\nsuggestions panel\r\n\r\nMetrics consistency\r\n\r\n<img width=\"568\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/10977896/3384bb8e-6152-4bae-93dc-4f7f4167ed07\">\r\n\r\nRun locally with \r\n```\r\nnode scripts/functional_tests --config x-pack/performance/journeys/many_fields_lens_editor.ts\r\n```\r\n\r\nMetrics will be available here \r\n\r\nhttps://telemetry-v2-staging.elastic.dev/s/kibana-performance/app/dashboards#/view/dd0473ac-826f-5621-9a10-25319700326e?_g=h@61c5ac8\r\n\r\n---------\r\n\r\nCo-authored-by: Drew Tate <[email protected]>","sha":"15b118c724d174d1482ae9a31f9e87dccfe2a66c","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["performance","release_note:skip","v8.10.0","v8.11.0"],"number":163412,"url":"https://github.com/elastic/kibana/pull/163412","mergeCommit":{"message":"[Lens] add performance journey to track rendering time for XY visualization and suggestions panel (#163412)\n\n## Summary\r\n\r\nRelated to #163089\r\n\r\nAdding the first performance journey for the Lens Editor. It simulated\r\nloading existing Lens visualisation with data view having 10k fields.\r\n\r\nWe collect the following metrics:\r\n- `fetchFieldsExistenceInfo` reports time it takes to fetch fields in\r\nData Panel\r\n- `lensVisualizationRenderTime` reports both time it takes to fetch the\r\ndata (`time_to_data`) and render the main visualization\r\n(`time_to_render`)\r\n- `lensSuggestionsRenderTime` reports time it takes to render\r\nsuggestions panel\r\n\r\nMetrics consistency\r\n\r\n<img width=\"568\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/10977896/3384bb8e-6152-4bae-93dc-4f7f4167ed07\">\r\n\r\nRun locally with \r\n```\r\nnode scripts/functional_tests --config x-pack/performance/journeys/many_fields_lens_editor.ts\r\n```\r\n\r\nMetrics will be available here \r\n\r\nhttps://telemetry-v2-staging.elastic.dev/s/kibana-performance/app/dashboards#/view/dd0473ac-826f-5621-9a10-25319700326e?_g=h@61c5ac8\r\n\r\n---------\r\n\r\nCo-authored-by: Drew Tate <[email protected]>","sha":"15b118c724d174d1482ae9a31f9e87dccfe2a66c"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/163412","number":163412,"mergeCommit":{"message":"[Lens] add performance journey to track rendering time for XY visualization and suggestions panel (#163412)\n\n## Summary\r\n\r\nRelated to #163089\r\n\r\nAdding the first performance journey for the Lens Editor. It simulated\r\nloading existing Lens visualisation with data view having 10k fields.\r\n\r\nWe collect the following metrics:\r\n- `fetchFieldsExistenceInfo` reports time it takes to fetch fields in\r\nData Panel\r\n- `lensVisualizationRenderTime` reports both time it takes to fetch the\r\ndata (`time_to_data`) and render the main visualization\r\n(`time_to_render`)\r\n- `lensSuggestionsRenderTime` reports time it takes to render\r\nsuggestions panel\r\n\r\nMetrics consistency\r\n\r\n<img width=\"568\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/10977896/3384bb8e-6152-4bae-93dc-4f7f4167ed07\">\r\n\r\nRun locally with \r\n```\r\nnode scripts/functional_tests --config x-pack/performance/journeys/many_fields_lens_editor.ts\r\n```\r\n\r\nMetrics will be available here \r\n\r\nhttps://telemetry-v2-staging.elastic.dev/s/kibana-performance/app/dashboards#/view/dd0473ac-826f-5621-9a10-25319700326e?_g=h@61c5ac8\r\n\r\n---------\r\n\r\nCo-authored-by: Drew Tate <[email protected]>","sha":"15b118c724d174d1482ae9a31f9e87dccfe2a66c"}},{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Dzmitry Lemechko <[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
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.
requestAnimationFrame
calls as a temporary solution to Render reported before complete elastic-charts#2124