Get FPS and GPU information from my chrome extension.

150 views
Skip to first unread message

Samuel

unread,
May 20, 2020, 10:42:12 PM5/20/20
to Chromium Extensions
Hey guys,

I've created a chrome extension that uses the chrome.processes API which I can use to get various piece of information about CPU usage, memory usage, etc. However, I'd like to use also a google API to get FPS and GPU info (I know I can't get the GPU usage, but I'd like to know what info I could get from my gpu). Is there an API that I can use to get these info? What type of info could I get related to my GPU (using my chrome extension)?

Best regards,
Samuel

Deco

unread,
May 20, 2020, 11:57:54 PM5/20/20
to Samuel, Chromium Extensions
GPU articulation is done through WebGL, also referred to as Open-WebGL, it's documentation can be found here: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API

Regards,
Deco

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/6ebb3172-c595-4c28-ba88-d4d9891c72f7%40chromium.org.

Samuel

unread,
May 21, 2020, 12:30:37 PM5/21/20
to Chromium Extensions, ssdasi...@gmail.com
Thanks, is it possible to get the value of FPS from a chrome API? I know I can use the flag "show-fps-counter", but could I have access to this value via my chrome extension?


On Thursday, May 21, 2020 at 12:57:54 AM UTC-3, Deco wrote:
GPU articulation is done through WebGL, also referred to as Open-WebGL, it's documentation can be found here: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API

Regards,
Deco

On Thu, 21 May 2020, 03:42 Samuel, <ssdasi...@gmail.com> wrote:
Hey guys,

I've created a chrome extension that uses the chrome.processes API which I can use to get various piece of information about CPU usage, memory usage, etc. However, I'd like to use also a google API to get FPS and GPU info (I know I can't get the GPU usage, but I'd like to know what info I could get from my gpu). Is there an API that I can use to get these info? What type of info could I get related to my GPU (using my chrome extension)?

Best regards,
Samuel

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

Deco

unread,
May 21, 2020, 12:51:29 PM5/21/20
to Samuel, Chromium Extensions
No this is not possible, no API exists which allows for fetching such variables.

On Thu, 21 May 2020 at 17:30, Samuel <ssdasi...@gmail.com> wrote:
Thanks, is it possible to get the value of FPS from a chrome API? I know I can use the flag "show-fps-counter", but could I have access to this value via my chrome extension?

On Thursday, May 21, 2020 at 12:57:54 AM UTC-3, Deco wrote:
GPU articulation is done through WebGL, also referred to as Open-WebGL, it's documentation can be found here: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API

Regards,
Deco

On Thu, 21 May 2020, 03:42 Samuel, <ssdasi...@gmail.com> wrote:
Hey guys,

I've created a chrome extension that uses the chrome.processes API which I can use to get various piece of information about CPU usage, memory usage, etc. However, I'd like to use also a google API to get FPS and GPU info (I know I can't get the GPU usage, but I'd like to know what info I could get from my gpu). Is there an API that I can use to get these info? What type of info could I get related to my GPU (using my chrome extension)?

Best regards,
Samuel

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/9efa857a-7e54-4aa4-a5a3-8d651cdf4fca%40chromium.org.

Samuel

unread,
May 21, 2020, 12:56:14 PM5/21/20
to Chromium Extensions, ssdasi...@gmail.com


On Thursday, May 21, 2020 at 1:51:29 PM UTC-3, Deco wrote:
No this is not possible, no API exists which allows for fetching such variables.

On Thu, 21 May 2020 at 17:30, Samuel <ssdasi...@gmail.com> wrote:
Thanks, is it possible to get the value of FPS from a chrome API? I know I can use the flag "show-fps-counter", but could I have access to this value via my chrome extension?

On Thursday, May 21, 2020 at 12:57:54 AM UTC-3, Deco wrote:
GPU articulation is done through WebGL, also referred to as Open-WebGL, it's documentation can be found here: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API

Regards,
Deco

On Thu, 21 May 2020, 03:42 Samuel, <ssdasi...@gmail.com> wrote:
Hey guys,

I've created a chrome extension that uses the chrome.processes API which I can use to get various piece of information about CPU usage, memory usage, etc. However, I'd like to use also a google API to get FPS and GPU info (I know I can't get the GPU usage, but I'd like to know what info I could get from my gpu). Is there an API that I can use to get these info? What type of info could I get related to my GPU (using my chrome extension)?

Best regards,
Samuel

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

Chase Leslie

unread,
May 21, 2020, 2:11:56 PM5/21/20
to Chromium Extensions, ssdasi...@gmail.com
You could perhaps use requestAnimationFrame to get an approximation of the FPS. This won't tell you anything about the hardware specifically, but rather what rate the browser is trying to render at.

Samuel

unread,
May 21, 2020, 2:47:06 PM5/21/20
to Chromium Extensions, ssdasi...@gmail.com
Thanks for you suggestion. I've developed the following code:

class FPS{
    constructor(){
        let time = new Date();
        this._lastUpdatedTime = time.getTime();
        window.requestAnimationFrame(this.step.bind(this));
    }

    step() {
        let time = new Date();
        let now = time.getTime();
        let FPS = 1000/(now - this._lastUpdatedTime);
        this._lastUpdatedTime = now;
        console.log("FPS", FPS)
        window.requestAnimationFrame(this.step.bind(this));
    }
}

const fps = new FPS();

But in the end, I got something close to 60 FPS, which I think is the frame rate of my display and not from my application (when I use the flag "show-fps-counter" I got something close to 30 FPS). Any suggestion? 
Reply all
Reply to author
Forward
0 new messages