18

I noticed this today in my Chrome.

Google Meet CPU Usage chart

Google Meet is showing a chart of CPU usage in their "Troubleshooting" panel. I'm wondering if there's an existing API for this or is it a clever trick I'm not aware of.

Paweł Badeński
  • 399
  • 3
  • 12

2 Answers2

12

I was curious about this as well when I saw the CPU Usage graph on the Troubleshooting page on the Google Meet's page. So googled a lot and I couldn't find any proper answer as to how it is being achieved apart from this link: https://developer.chrome.com/extensions/system_cpu#method-getInfo.

So, I went through the minified source code of the Google Meet's site and it turns out Google Meet is using this but not on their webpage directly, because it is for chrome extensions only, but through the Google Hangouts Extension which is present in Chrome, Brave and the new Microsoft Edge (Chromium-based).

enter image description here

The chrome extension is calling the chrome.system.cpu API to get the information about the processor, core count, temperatures, etc., and these details are being passed to the Google Meets page via window.postMessage API and Message Passing between Chrome Extension and a Webpage.

This is a neat little way to achieve this if you are the creator of the browser :P.

Matthias
  • 13,607
  • 9
  • 44
  • 60
Vibhor
  • 535
  • 4
  • 14
  • Example: https://books.google.de/books?id=KtYNEAAAQBAJ&pg=PA119&lpg=PA119&dq=chrome+api+gpuCpuUsage+browserCpuUsage&source=bl&ots=VVx7ruhQdA&sig=ACfU3U056XyPVaJ7uAFuNkHrBlQ4lnraVw&hl=en&sa=X&ved=2ahUKEwjwvPXKqMHuAhUR2KQKHf4WBTMQ6AEwCnoECBUQAg#v=onepage&q=chrome%20api%20gpuCpuUsage%20browserCpuUsage&f=false as pdf https://www.cse.chalmers.se/~andrei/cans20.pdf – printminion Jan 29 '21 at 14:27
  • Hi @Vibhor where did you figure out the GOogle Hangouts extension is installed by default in Chrome. I mean your screenshot, how can I check that? – Duc Trung Mai Oct 20 '21 at 16:00
  • 1
    Open this page `chrome://inspect/#extensions`, you'll find `Google Hangouts` as pre-installed extensions. – Ritwick Dey Apr 05 '22 at 06:22
  • On a tangent, the [CPU Pressure API](https://developer.chrome.com/docs/web-platform/compute-pressure/) is one proposal how to expose such data directly to the browser. – DenverCoder9 Jul 26 '22 at 21:54
  • Interesting find @DenverCoder9. Google is finally working on making this API publically accessible to the devs. Currently, it is in its initial draft stage but let's hope it gets approved and implemented in the near future. – Vibhor Sep 16 '22 at 12:03
2

Most probably, they are using Chrome specific API since this will not work on other browsers. The closest thing that I've found is https://developer.chrome.com/extensions/system_cpu#method-getInfo

Below is a screenshot from Firefox stating that this will work only on Chrome.

Snapshot from Firefox

amd
  • 20,637
  • 6
  • 49
  • 67