-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ref(profiling): reinitialize profilerId on explicit stop calls #13681
Conversation
size-limit report 📦
|
|
||
// There is no off method to disable this, so we need to ensure to add the listener only once. This adds overhead | ||
// to the event processing, but it is minimal as we short circuit if there is no profilerId active and return early. | ||
this._client.on('beforeSendEvent', this._onBeforeSendThreadContextAssignment.bind(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.
on
should return a function that deregisters a callback. We can use that to disable it.
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.
Ahh, I missed that! I'll keep the same implementation I think bc of simplicity, but let me remove that comment
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.
Removed it and left a comment for future optimization
Modifies the functionality of profiler start and stop calls to regenerate the profilerId