Hi!I'm interested in implementing the CPU Profile API for WebDriver (well the chrome version of it).I asked guidance from klm@google.com and stgao@chromium.org, since they implemented the perf logging and the heapSnapshot. And they gave me the first indication about where to look.So I debugged the DevTools protocol and analyzed protocol.json. It seems that the message exchange is fairly simple:console.profile or clicking on the record will trigger over websockets: -> {"method":"Profiler.start","id":xxxx}console.profileEnd or clicliend EndRecrod will trigger over websokets: -> {"method":"Profiler.stop","id":28}And the return payload will be a JSON object like: "result": { "profile": { "head": { ... }}} Given this format exchange, I think the implementation it shouldn't be hard to do....
Moreover I saw the code that stgao implemented for the takeHeapSnapshot and basically he created a special Execute function on the window_commands.cc, that delegates into WebView new function, and a special module to do the heavy lifting, so the usage is fairly simple: https://code.google.com/p/chromedriver/issues/detail?id=519Given that this is probably a non standard WebDriver feature I think I should follow the same pattern and creating another Executor function on window_commands.cc that relies on the web_view and has a class to manage the results.
Hi!I'm interested in implementing the CPU Profile API for WebDriver (well the chrome version of it).I asked guidance from klm@google.com and stgao@chromium.org, since they implemented the perf logging and the heapSnapshot. And they gave me the first indication about where to look.So I debugged the DevTools protocol and analyzed protocol.json. It seems that the message exchange is fairly simple:console.profile or clicking on the record will trigger over websockets: -> {"method":"Profiler.start","id":xxxx}console.profileEnd or clicliend EndRecrod will trigger over websokets: -> {"method":"Profiler.stop","id":28}
And the return payload will be a JSON object like: "result": { "profile": { "head": { ... }}} Given this format exchange, I think the implementation it shouldn't be hard to do....
Moreover I saw the code that stgao implemented for the takeHeapSnapshot and basically he created a special Execute function on the window_commands.cc, that delegates into WebView new function, and a special module to do the heavy lifting, so the usage is fairly simple: https://code.google.com/p/chromedriver/issues/detail?id=519Given that this is probably a non standard WebDriver feature I think I should follow the same pattern and creating another Executor function on window_commands.cc that relies on the web_view and has a class to manage the results.Does this seems like the right direction to start coding this feature?Do you guys need more details?Can anyone throw more light to this or some other details I may be missing?Thanks!
--
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/ae0506ef-dd44-48e5-b56d-b765747d6f50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.