I have a trace events JSON data and I want to view it using chrome://tracing
. However, I don’t want to load the JSON every time.
Is there a way I can pass the JSON data to chrome://tracing
so that without manually clicking load data all my data gets loaded?
Open chrome://tracing in a Chrome tab, and drag that trace. json file into the chrome://tracing window. You'll see something that looks like this: The trace that Electron recorded includes events from the main process as well as the renderer process.
@UmeshPatil In Chrome you should just right click by mouse and choose "Open in new tab" at the method which returns JSON data from "Network" -> "XHR" tab of Chrome browser.
Distributed tracing library. Traces are really just a specialized form of log calls, therefore this module utilizes Automattic/log-json under the hood.
Here is a solution, if you can relax the requirement that you have to open it with Chrome-Tracing. Speedscope is a nice replacement and can be easily started from the command line.
For offline use, or convenience in the terminal, you can also install speedscope via npm:
npm install -g speedscope
Invoking speedscope /path/to/profile will load speedscope in your default browser. Source
speedscope <my-chrome-tracing.json>
opens the file.
Speedscopes offers different views but not sometimes not the same view as Chrome-Tracing. So it might not be the right choice for all use cases.
The Trace-viewer tool currently loads the JSON file in 3 ways:
All of these do a one-time update to the active trace.
Look at the profiling_view and notice
tr.ui.b.readFile(file).then(
...
this.setActiveTrace(file.name, data);
and a few variations on calls to setActiveTrace from beginRecording , onLoadClicked_ and dropHandler_ .
Yes, there are a few ways in which you can pass the json data to chrome://tracing (i.e. trace viewer) without manually clicking load data .
Depending on how much effort you want to put into it:
See fswatch - a cross-platform file change monitor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With