-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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 performance journey to track rendering time for XY visualization and suggestions panel #163412
[Lens] add performance journey to track rendering time for XY visualization and suggestions panel #163412
Conversation
@@ -178,6 +179,8 @@ export const useExistingFieldsFetcher = ( | |||
const dataViewsHash = getDataViewsHash(params.dataViews); | |||
const refetchFieldsExistenceInfo = useCallback( | |||
async (dataViewId?: string) => { | |||
const startTime = window.performance.now(); |
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.
@jughosta does the way we're thinking of measuring field list loading make sense to you?
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.
@drewdaemon Yes, currently we get fields from dataView class and make this additional call to separate "Empty" fields in the sidebar. As long as we specify that it's fetchFieldsExistenceInfo
request metrics, it's correct.
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.
The calculations for grouping logic are happening in packages/kbn-unified-field-list/src/hooks/use_grouped_fields.ts
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 what we're really going for the total time it takes to load the field list in Lens.
It sounds like you're saying we can assume that the fields are already present on the client so this existence check is the only network call we need to account for. Is that right?
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.
@drewdaemon Yes, right now it's the only request we make for the field list. But it will change in the future. @mattkime is working on RFC to load fields async and separately from data view info. Once we apply this change, we can sum both loading durations.
reportPerformanceMetricEvent(params.services.core.analytics, { | ||
eventName: metricEventName, | ||
duration: window.performance.now() - startTime, | ||
meta: { dataViews: params.dataViews.map((v) => v.name) }, |
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 want to track data view name or data view id to apply the same in both places?
meta: { dataViewId },
vs
meta: { dataViews: params.dataViews.map((v) => v.name) },
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.
@jughosta good catch! Probably name is easier to understand but I'm curious if from development perspective it is better to have id?
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.
Not sure how we would use this meta info. Another idea: store only data views count.
await page.waitForSelector(subj('table-is-ready')); | ||
// wait extra 5 seconds | ||
await page.waitForTimeout(5000); | ||
}) |
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.
Data Discovery changes 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.
ftr_configs.yml
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 is great. I suggest we document the reason for the pause in a code comment.
Thanks for your great work on 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.
LGTM
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…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":"#163412 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":"#163412 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
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 PanellensVisualizationRenderTime
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 panelMetrics consistency
Run locally with
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