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

[Inspector] Make Response tab faster #180035

Merged
merged 7 commits into from Apr 5, 2024

Conversation

jughosta
Copy link
Contributor

@jughosta jughosta commented Apr 4, 2024

Summary

This PR improves the speed of "Response" tab rendering in the Inspector flyout. The issue was that the heavy logic of building links ("Open in Console", "Open in Search Profiler") was executed for Response tab too although links can appear only for Request tab.

@jughosta jughosta added release_note:fix Feature:Inspector Inspector infrastructure and implementations Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) backport:prev-minor Backport to the previous minor version (i.e. one version back from main) labels Apr 4, 2024
@jughosta jughosta self-assigned this Apr 4, 2024
@jughosta
Copy link
Contributor Author

jughosta commented Apr 4, 2024

/ci

@jughosta jughosta marked this pull request as ready for review April 4, 2024 13:45
@jughosta jughosta requested a review from a team as a code owner April 4, 2024 13:45
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@nreese nreese self-requested a review April 4, 2024 14:10
@jughosta
Copy link
Contributor Author

jughosta commented Apr 4, 2024

@nreese Thanks for reviewing! I refactored into using actions as a prop but to build them I needed to create an intermediate function component RequestDetailsRequestContent as RequestDetailsRequest class component would not be able to run locator methods with hooks.

So here is a new tree structure:

  • RequestDetails > RequestDetailsRequest > RequestDetailsRequestContent > RequestCodeViewer
  • RequestDetails > RequestDetailsResponse > RequestCodeViewer

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for cleaning this up. That makes a lot of sense to not parse and process the response since its much larger then request and there is no need for all of this processing.
code review only

@jughosta jughosta enabled auto-merge (squash) April 5, 2024 08:44
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
inspector 60 61 +1

Async chunks

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

id before after diff
inspector 28.0KB 28.1KB +123.0B

History

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

cc @jughosta

@jughosta jughosta merged commit 7a00d2e into elastic:main Apr 5, 2024
17 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 5, 2024
## Summary

This PR improves the speed of "Response" tab rendering in the Inspector
flyout. The issue was that the heavy logic of building links ("Open in
Console", "Open in Search Profiler") was executed for Response tab too
although links can appear only for Request tab.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 7a00d2e)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.13

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Apr 5, 2024
# Backport

This will backport the following commits from `main` to `8.13`:
- [[Inspector] Make Response tab faster
(#180035)](#180035)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2024-04-05T11:05:07Z","message":"[Inspector]
Make Response tab faster (#180035)\n\n## Summary\r\n\r\nThis PR improves
the speed of \"Response\" tab rendering in the Inspector\r\nflyout. The
issue was that the heavy logic of building links (\"Open
in\r\nConsole\", \"Open in Search Profiler\") was executed for Response
tab too\r\nalthough links can appear only for Request
tab.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"7a00d2e24b38bbdb5b41c31fe0658d78067ee679","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Inspector","Team:DataDiscovery","backport:prev-minor","v8.14.0"],"title":"[Inspector]
Make Response tab
faster","number":180035,"url":"#180035
Make Response tab faster (#180035)\n\n## Summary\r\n\r\nThis PR improves
the speed of \"Response\" tab rendering in the Inspector\r\nflyout. The
issue was that the heavy logic of building links (\"Open
in\r\nConsole\", \"Open in Search Profiler\") was executed for Response
tab too\r\nalthough links can appear only for Request
tab.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"7a00d2e24b38bbdb5b41c31fe0658d78067ee679"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"#180035
Make Response tab faster (#180035)\n\n## Summary\r\n\r\nThis PR improves
the speed of \"Response\" tab rendering in the Inspector\r\nflyout. The
issue was that the heavy logic of building links (\"Open
in\r\nConsole\", \"Open in Search Profiler\") was executed for Response
tab too\r\nalthough links can appear only for Request
tab.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"7a00d2e24b38bbdb5b41c31fe0658d78067ee679"}}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to the previous minor version (i.e. one version back from main) Feature:Inspector Inspector infrastructure and implementations release_note:fix Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) v8.13.2 v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants