3

I saw this CPU Usage real-time chart in the Google Meet's Troubleshooting section and I was wondering how to get the CPU Usage details in the browser so that I can plot a real-time chart on my webpage.

I googled about it a lot but couldn't find any proper solution about the topic that can directly work on the browser without, apart from the logical core count that navigator.hardwareConcurrency returns.

Maybe using WebAssembly this can be achieved?

enter image description here

P.S.: This is for research purposes and for use in my personal projects.

Vibhor
  • 535
  • 4
  • 14
  • This proposal's explainer [talks about](https://github.com/WICG/js-self-profiling#facebooks-profiler-polyfill) something facebook would have done using a Worker and SharedArrayBuffers, but I'm not able to find a source for this "profiler" in a fast research. Maybe you'll get more luck than myself. (and on localhost you can also try the API directly on chrome, though I don't know how easy to infer CPU usage from this). – Kaiido Dec 17 '20 at 14:33
  • @Kaiido I think this Facebook Profiler is more or less similar to the profiler that is there in Chrome but Facebook is trying to make it accessible as a JS API so that more users can use it plus they have been using it in some of their sites. But this is not what I am looking for plus I think this is not how the CPU Usage graph above is implemented. I did some research in the past 2 days and I actually found out how Google is getting the CPU Usage and I'll be posting that as an answer sometime today. – Vibhor Dec 20 '20 at 07:28
  • Not at all no. The Facebook profiler they talk about was 100% JS, it used SharedArrayBuffers and a Worker. That wasn't a built-in profiler at all (FB doesn't do browsers). – Kaiido Dec 20 '20 at 07:35
  • Added link to the answer that was posted by me here: https://stackoverflow.com/a/65378446/4410366 – Vibhor Dec 20 '20 at 11:30

0 Answers0