Skip to content
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

Merged
merged 17 commits into from
Aug 17, 2023

Conversation

dmlemeshko
Copy link
Member

@dmlemeshko dmlemeshko commented Aug 8, 2023

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

image

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

@@ -178,6 +179,8 @@ export const useExistingFieldsFetcher = (
const dataViewsHash = getDataViewsHash(params.dataViews);
const refetchFieldsExistenceInfo = useCallback(
async (dataViewId?: string) => {
const startTime = window.performance.now();
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor

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) },
Copy link
Contributor

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) },

Copy link
Member Author

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?

Copy link
Contributor

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.

@dmlemeshko dmlemeshko added release_note:skip Skip the PR/issue when compiling release notes v8.10.0 performance labels Aug 8, 2023
Comment on lines 21 to 24
await page.waitForSelector(subj('table-is-ready'));
// wait extra 5 seconds
await page.waitForTimeout(5000);
})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without extra sleep metrics are inconsistent
image

With 5 extra sec wait on landing page
image

@dmlemeshko dmlemeshko marked this pull request as ready for review August 16, 2023 06:19
@dmlemeshko dmlemeshko requested review from a team as code owners August 16, 2023 06:19
Copy link
Contributor

@jughosta jughosta left a 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 👍

Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ftr_configs.yml

Copy link
Contributor

@drewdaemon drewdaemon left a 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!

x-pack/performance/journeys/many_fields_lens_editor.ts Outdated Show resolved Hide resolved
Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #49 / Actions and Triggers app Home page Loads the app with limited privileges Loads the Alerts page
  • [job] [logs] FTR Configs #58 / Machine Learning modules get_module lists all modules

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
discoverLogExplorer 313 317 +4
eventAnnotation 322 326 +4
lens 1135 1139 +4
total +12

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 557.4KB 557.7KB +340.0B
lens 1.4MB 1.4MB +775.0B
total +1.1KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.10

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 17, 2023
…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)
kibanamachine added a commit that referenced this pull request Aug 17, 2023
…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]>
@dmlemeshko dmlemeshko deleted the perf/add-lens-editor-journey branch November 21, 2023 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance release_note:skip Skip the PR/issue when compiling release notes v8.10.0 v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants