-
Notifications
You must be signed in to change notification settings - Fork 73
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
chore: re-enable performance metrics #598
base: main
Are you sure you want to change the base?
Conversation
@adhorodyski may i ask you to review please as we will use those changes together in newdot? I tested and confirmed that we can use the performance entries recorded in Onyx in NewDot when using |
// @ts-expect-error Reassign | ||
addAllSafeEvictionKeysToRecentlyAccessedList = decorateWithMetrics(addAllSafeEvictionKeysToRecentlyAccessedList, 'OnyxUtils.addAllSafeEvictionKeysToRecentlyAccessedList'); | ||
// @ts-expect-error Reassign | ||
keysChanged = decorateWithMetrics(keysChanged, 'OnyxUtils.keysChanged'); |
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.
❤️ love 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.
yeah i only hate the ts-expect-error
suppressions 🤔
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 really like the changes, this is exactly what we wanted to achieve 😊 Thanks @hannojg!
@hannojg Code looks good to me, but it appears you have some merge conflicts. |
Ah right; will update tomorrow, thanks for checking guys! |
@deetergp this is good to be merged now 😊 |
Details
For this ticket:
We'd like to have the possibility to very granularly measure the performance of every onyx step during a user action in the newdot app.
In the past we had a performance utility which was removed during the typescript migration though:
This adds it "back" with a few differences though:
OnyxUtils
andStorage
(this way we really get the full picture how long each sub step tool)GlobalSettings
was introduced into which utility functions can hook to optionally decorate their functions with performance measurementsThe default setting is that we don't apply the performance decoration.
In NewDot we can simply use react-native-performance to read the performance entries from onyx.
Related Issues
Expensify/App#50652
Automated Tests
Internal dev tooling only
Manual Tests
I compiled the changes and tested them in newdot - nothing broke.
Author Checklist
### Related Issues
section aboveTests
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop