-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
perf: add trace for UI startup (#26636) [cherry-pick] #26925
Conversation
6654704
to
baa689c
Compare
Builds ready [e1e4021]
Page Load Metrics (1681 ± 56 ms)
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## Version-v12.2.0 #26925 +/- ##
===================================================
- Coverage 70.49% 70.49% -0.00%
===================================================
Files 1400 1400
Lines 49611 49687 +76
Branches 13647 13655 +8
===================================================
+ Hits 34971 35024 +53
- Misses 14640 14663 +23 ☔ View full report in Codecov by Sentry. |
ui/pages/confirmations/confirm-transaction/confirm-transaction.component.js
Outdated
Show resolved
Hide resolved
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.
Shouldn't impact the build as it's developer only, though it applies the new TraceName
enum.
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.
Easier to leave this change in I think, to avoid a type error. The trace
utility requires the enum to be used. We could adjust it to remove that requirement, but doesn't seem useful to do so
I have tested this and it works as expected. (But I did not test transactions, as per Matthew's comments above) |
Refactor `trace` utility function to support no callback argument and only start a trace to be manually ended later. Add `endTrace` utility function. Add `endBackgroundTrace` action to contribute to background metrics from the UI. Always trace if in developer build or `METAMASK_DEBUG` is set. Pass `trace` callback and `traceContext` to `TransactionController`.
Support use of `trace` utility function in non-asynchronous contexts. Remove `getMetaMetricsEnabled` check. Generate default ID if omitted when starting and ending traces.
1d34547
to
19daa9f
Compare
I have re-tested this locally with the unnecessary code removed, and it seems to work correctly still |
Just retested as well. LGTM |
Builds ready [19daa9f]
Page Load Metrics (1742 ± 103 ms)
|
No release label on PR. Adding release label release-12.2.0 on PR, as PR was cherry-picked in branch 12.2.0. |
This is a cherry-pick of #26332 and #26636 for v12.2.0, with the TransactionController update removed from #26332.
Follow these steps to manually test:
metamask
projectSENTRY_DSN_DEV
in your.metamaskrc
fileYou should see the UI traces in the Sentry performance dashboard on your personal account.
This was cherry-picked to get the benefits described in #26636 (#26332 was partially included only out of necessity). The original description of #26636 is below:
Description
Record a
UI Startup
Sentry trace to monitor startup times of the UI pages.In addition:
trace
utility function in non-asynchronous contexts.getMetaMetricsEnabled
check as this is already done in the custom transport before submission.Related issues
Fixes: #25724
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist