Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to start & stop content tracing #71

Open
robatwilliams opened this issue Mar 28, 2019 · 5 comments
Open

Ability to start & stop content tracing #71

robatwilliams opened this issue Mar 28, 2019 · 5 comments
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted

Comments

@robatwilliams
Copy link

robatwilliams commented Mar 28, 2019

Issuehunt badges

https://electronjs.org/docs/api/content-tracing

Trigger it using a keyboard shortcut. Read options from a file having a well-known name in the same folder. If no file found then create one and populate it with some default options.

There is a $60.00 open bounty on this issue. Add more on Issuehunt.

@sindresorhus
Copy link
Owner

It's not really clear to me how it will be used. If we add ability to start and stop it, how would you see the result? Can you elaborate a bit more about how you imagine working with it and what problems it solves?

@robatwilliams
Copy link
Author

Beyond its use in Chromium for detailed tracing, content tracing is of further use in Electron to provide a unified view of application activity across all the processes on a single timeline.

The trace viewer (chrome://tracing) is not included in Electron, so the trace data is saved to a file by the contentTracing.stopRecording(resultFilePath) method. It can then be opened in the trace viewer of any Chromium browser.

That all works today, but it requires me to modify and rebuild my application code to start/stop the tracing at the right moment. I would prefer to be able to start and stop arbitrarily by user interaction, to provide convenience similar to that offered by the devtools Performance tab.

How I imagine it working:

  1. Create a file of the name contentTracingOptions.json in the launch directory. These will be passed to contentTracing.startRecording(options). This step is optional; if the file is not found, default options would be passed.
  2. Start the tracing with Ctrl Shift T or similar
  3. Stop tracing using the same shortcut
  4. electron-debug passes the launch directory to stopTracing(resultFilePath), causing Electron to write the trace file in that location

@sindresorhus
Copy link
Owner

sindresorhus commented May 12, 2019

Thanks for elaborating. Yes, this would be a good addition here. I think it should be opt-in through an option though.

Would it maybe also be useful if electron-debug also opened the trace file in Chrome after step 4?

@robatwilliams
Copy link
Author

Yes probably.

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 15, 2019
@IssueHuntBot
Copy link

@IssueHunt has funded $60.00 to this issue.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted
Projects
None yet
Development

No branches or pull requests

3 participants