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
Using a single observer instance throughout the application lifetime #160
Comments
It seems like you called the observer multiple times with Looking at https://www.w3.org/TR/performance-timeline-2/#observe-method step 7.3 suggests that you should be allowed to do that and that it should replace the previously registered options with the new ones. Looking at the Chromium code that doesn't seem to be what's happening. @npm1 - halp? |
Trying to summarize the use case: you're disconnecting the observer and later want to reuse it by calling observe() again, right? I think this is reasonable and there are actually two problems:
|
Ok, I think this is now fixed, so closing this. Feel free to play with Chrome and other browser vendors (if they support 'type' yet?). If a specific one is not working as expected, probably best to file a bug with them directly. |
Thanks both for the detailed explanation and also for the fixes. |
I am using PerformanceObserver to capture some of the new entries like
paint
,longtask
, etc. While its possible to create a new PerformanceObserver every-time and start observing for entry types that we are interested in and get notified for the same.Isn't ideal to create a single observer for capturing the overall user journey and call
observe
whenever we are interested in the entries and calldisconnect
to remove the observer during idle time.Currently if I try to reuse the same observer, we get the below warning on the browser console
I might be totally using the observer in a wrong way, would like to know more on which approach is preferred and does creating observer for every navigation including soft/hard wouldn't be a performance issue.
The text was updated successfully, but these errors were encountered: