designcourse
designcourse copied to clipboard
reporting of browser metrics
our app is a large single page application, and we've had bugs in the past that caused a lot of memory bloat in the browser, or where the browser UI becomes somewhat unresponsive
it would be great if there were some way for the RUM package to report back memory usage and/or some kind of latency on the event loop to see if an SPA has become less responsive. I'm thinking if you could set a polling interval (like every 1 second or every 30 seconds, or whenever, where you call the performance.memory
API, and also do something like:
const now = performance.now();
setTimeout(function reportPerformance() {
reportEventLoopLatency(performance.now() - now);
}, 0);
(Yes, I know setTimeout
has a built in throttle... could also try using Promise.resolve().then(...)
though that's measuring something slightly different)
const now = performance.now();
Promise.resolve().then(function reportPerformance() {
reportEventLoopLatency(performance.now() - now);
});
Hi @alecf
Thanks for your proposal. We are currently investing in a better way to display long tasks which will help you figure out where latency occurs in your SPA. Do you see that as a potential solution to you?
About memory usage, this is something we are considering for the future but not a top priority for us.
We'll keep you updated ;)
Similarly, I want to be able to track latency of response/reply messages over a websocket. I have it computed using our own echo messages and I'd like to emit the data for Datadog RUM.
Right now I can do this using addAction
, and I'm wondering if there's a better way.