-
Notifications
You must be signed in to change notification settings - Fork 6
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
BrowserProcessor's 'performance' entry is always {} #55
Conversation
I had noticed that indeed.
|
Not really, but the Chrome team seems to have intentianally designed window.performance.memory like a special snowflake (quantized values that only change every 20 minutes and hide small changes...)
No simple one, for the reasons above (super specific class) The only generic way I found to access "all the properties in window.performance.memory" was I do think the intended use is to access each known property individally and explicitly.
Nope, window.performance.memory is Chrome-only at the moment. If later on some other browser happened to add window.performance.memory as well, but without, say, the jsHeapSizeLimit property, then window.performance.memory.jsHeapSizeLimit would just be undefined, no big deal.
Will fix it |
About "some more compact way" :
but since that requires a full-fledged if / then / else instead of the ternary, that's not really shorter :-) |
I think we want to put this under windows.performance.memory, not under window.performance, though ? Otherwise we're losing any other content present under that standard key https://developer.mozilla.org/en-US/docs/Web/API/Performance Which also means we need to check if window.performance is present at all in the result: this might be missing in a virtual browser, e.g. during SSR. |
Discussed offline: since this overwriting is an earlier feature/bug, and we don't want to copy the whole |
window.performance.memory is an object of class MemoryInfo, which doesn't serialize to JSON : `JSON.stringify(window.performance.memory)` is `"{}"` We need to explicitly include the three properties.
Merged. |
window.performance.memory is an object of class MemoryInfo, which doesn't serialize to JSON :
JSON.stringify(window.performance.memory)
is"{}"
We need to explicitly include the three properties.