Auto record and save chrome developer tools profiling data on page load?

1,497 views
Skip to first unread message

Komail Badami

unread,
Feb 2, 2016, 2:46:24 AM2/2/16
to Google Chrome Developer Tools

Chrome developer tools has an option to Start/Stop Recording profiling data with respect to Memory,Paint,Screenshots,JS Profile on the Timeline Panel. Once I refresh a page the recording begins automatically and stops when the page has loaded.

Is there a way to

1)Start this recording in the background automatically without needing to open developer tools in chrome/node-webkit window. Maybe the recording can be enabled via some Chrome API which can be called when the application loads

2)Dump the recorded data into a log file (e.x. a json file) once the recording is over.

Any pointers in the right direction will be appreciated.

Paul Irish

unread,
Feb 2, 2016, 3:46:38 AM2/2/16
to Google Chrome Developer Tools

Yup!

Here you go:
https://github.com/paulirish/automated-chrome-profiling/blob/master/readme.md#timeline-recording-example

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/89158831-59a3-4fdc-ac2a-57175767624c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Komail Badami

unread,
Feb 2, 2016, 5:26:07 AM2/2/16
to Google Chrome Developer Tools
Thank you Paul for the link and the wealth of information in it . I am particularly interested in using  them as Node APIs :)


On Tuesday, February 2, 2016 at 2:16:38 PM UTC+5:30, Paul Irish wrote:
On Feb 1, 2016 11:46 PM, "Komail Badami" <komailabb...@gmail.com> wrote:

Chrome developer tools has an option to Start/Stop Recording profiling data with respect to Memory,Paint,Screenshots,JS Profile on the Timeline Panel. Once I refresh a page the recording begins automatically and stops when the page has loaded.

Is there a way to

1)Start this recording in the background automatically without needing to open developer tools in chrome/node-webkit window. Maybe the recording can be enabled via some Chrome API which can be called when the application loads

2)Dump the recorded data into a log file (e.x. a json file) once the recording is over.

Any pointers in the right direction will be appreciated.

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.
Message has been deleted

Paul Irish

unread,
Feb 3, 2016, 6:27:47 PM2/3/16
to Google Chrome Developer Tools
Hmm.

Either you're trying to send data across the websocket before it was opened.
Or the socket was closed already, and chrome-remote-interface isn't aware of it.

You'll probably have to debug this further yourself. You can report it at https://github.com/cyrus-and/chrome-remote-interface/issues if you need more help.



On Wed, Feb 3, 2016 at 3:02 AM, Komail Badami <komailabb...@gmail.com> wrote:
Hi Paul,

I was able to set up the remote debugging interface with port 9222 and launch the code which you shared. However, it failed to complete and threw me an error as below

C:\Users\komail22.badami\Desktop\chrome-remote-interface\node_modules\chrome-remote-interface\node_modules\ws\lib\WebSocket.js:218
    else throw new Error('not opened');
         ^

Error: not opened
    at WebSocket.send (C:\Users\komail22.badami\Desktop\chrome-remote-interface\node_modules\chrome-remote-interface\node_modules\ws\li
b\WebSocket.js:218:16)
    at Chrome.send (C:\Users\komail22.badami\Desktop\chrome-remote-interface\node_modules\chrome-remote-interface\lib\chrome.js:198:13)

Will the tracing complete and dump it to a file as in the code, I am expecting that to happen by looking at the code you've shared.

Can you please guide me on this.

Thanks!

On Tuesday, February 2, 2016 at 2:16:38 PM UTC+5:30, Paul Irish wrote:

Komail Badami

unread,
Feb 22, 2016, 2:23:06 AM2/22/16
to Google Chrome Developer Tools
Thanks Paul. I got it to work.

Now I've automated launching of chrome with remote debugging port 9222 on click of a button in my node-webkit based app and then begin tracing on my app.once chrome is ready. Once the page loading of my app is finished the trace is generated.I could even control it on click of a button to stop tracing.

The trace obviously has lot of information which needs to be filtered. I am looking specifically for cpu time , where cpu time =  javascript rendering time + painting time + other time... for the components in my web application. Can I limit tracing to generate only this information ? by specifying the TRACE_CATEGORIES  or parse and filter the trace file (this seems tedious and expensive). 

Hope to hear from you soon !
 
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages