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?
The Trace-viewer tool currently loads the JSON file in 3 ways:
When recording a new trace
When loading the file via the load button after the file has been picked
When dropping the file into the tab (drag & drop)
All of these do a one-time update to the active trace.
Technical details
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_ .
Solution suggestions
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:
Don't manually click load but drag and drop the file
Automate the drag & drop (example with selenium) based on a script which watches for file changes to the JSON
Automate the load based on file changes
Contribute to Trace Viewer yourself and add this feature. See the tracing ecosystem explainer and contributing. Note it is now part of the Catapult project in GitHub.
See fswatch - a cross-platform file change monitor.
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.
this GopherCon video shows another solution I guess, which is to load into the browser an HTML page, probably with embedded Javascript in it, that “loads” the trace file. Although I suspect not from a disk file but by “serving” it directly via a custom http server.
Related
I recently found out that Go compiles down to WebAssembly. Cool!
As per this Go doc, the Go toolchain itself is written in Go.
This made me think, can the Go compiler run in the browser? Can I make a website which given a file path through an upload button (though, without uploading anything), can compile a Go project and return the executable as a "download"?
The end result I'm looking for is an executable file saved to disk, not for the Go code to run in a browser, but I don't need the exact scenario above to be followed as long as that is the final result.
If this is possible, what are the limitations, if any?
Additional resources I have looked at:
A compiler from Go to WASM on GitHub
Someone working on a game where entered Go code runs in the browser
EDIT: I have started work on this, based on a similar project. The repo can be found here: https://github.com/TR-SLimey/IBGC
It is possible, but it's hard to do.
You can't access files using WebAssembly. Instead, you need the user to drop a folder inside the webpage and use the File and Directory Entries API to get the files and their contents.
But the real problem is passing the files from JS to WASM and vice-versa. You'll also need to replace in the compiler source code all the calls to the Go standard library that would access files to calls to JS functions. Those function need to access the WASM memory directly. You will need to modify the compiler quite a bit.
To download the binary, you can create a Blob, use URL.createObjectURL() to get an URL to that blob, create an <a> element with .download = true and .href = <the blob URL>, and then .click() it.
The performance might be worse than running the Go compiler directly, but other than that it should work just fine.
In SCM, there are different ways to load a components but I am bit confused with the "Load from a load rule file" option https://jazz.net/library/article/1016 I gone through this link and got to know how to load the loadrule file using "Load from a load rule file" option. Can anyone give me a brief note on "Load from a load rule file" and in what circumstances this option will give hand?
You have a good illustration of potential use cases in "Loading with Load Rules in Rational Team Concert 4.0 and later"
Load rules are a way of describing what is loaded from a repository workspace and where it should be loaded.
It could take several steps to load a repository workspace exactly as you would like in the sandbox and to repeat those steps can be error prone for yourself and other team members.
However, if the layout information is captured in load rules, they can be easily re-used by other team members when loading their repository workspace into their sandbox.
They can also be used in builds.
Another use case (in this thread): "How to maintain folder structure while selectively loading folders within SCM Component in RTC"
Once that is all done, you can capture 'how' you loaded everything in a load rule file so that in the future you can simply load from a load rule file instead of re-doing the steps above.
Navigate to "Window" --> "Preferences" --> "Team " --> "Jazz Source Control" --> "Sandboxes". Click on the sandbox that represents your eclipse workspace (or which ever sandbox you just loaded everything into) and select the "Generate Load Rules...". In the dialog you can choose where you want to save the load rule file and click "Generate".
We have a scenario where Box(box.com) has multiple versions for same file and we need to update and process the current version of file in our application.
Please let me know the process to upload new file version in same bucket and process it.
Currently, we are unable to render the updated Autodesk file view. It is still showing the old file view.
You can simply upload a new version of the file using the same bucketKey/objectKey pair, first make sure that you are using x-ads-force set to true in the header of your /POST job request.
The viewer is caching the data when loading a model, so once the translation is done, you also need to make sure you are clearing your cache or testing in incognito session.
See that article for more details: I Make Changes and Nothing Happens
Hope that helps.
I am attempting to create a "local only" status board with moveable "GUI" objects. Something to show physical location of items over a map. I have very strict security requirements. It would be best to have the items contained in a local file written in HTML or CSS. I cannot use a lamp, wamp or any stack that requires a server and I cannot install additional software.
Impossible?
To make Javascript work in a file viewed from the file system (as I see the challenge) you could write all your scripts in a script tag in the HTML file, and all your data as an object in that script block.
I have been reading tutorials and guides concerning this but have not found a straight forward answer to this.
I currently have an existing website running on a node.js platform, locally on my computer.
Goal: Now I want to try and write a simple hello world in Dart, export it to plain JavaScript and see it work in my existing website.
Reading the documents, I read that I should create a new "Web Application" and to create some sample code up and running, I check the "Generate sample content" box.
And my project is now created in Dart Editor:
I can run the sample in Dartium, see it work, etc.
But the problem is that I have now a .html file in the Dart-project, while I have a real .html file for my existing node website in a totally different path. I don't want that. I want to try and use the existing .html instead, since.. thats my real website.
But when trying to create a new Dartium launcher, I can only refer to .html files within my Dart-project:
So my big question is; How do actually start using Dart with my existing developed website?
How do I create that bridge?
On the second image above in your original question, there is an option just below the HTML file, called URL - is this what you're looking for? You can set that to any arbitrary URL.
You'd also need to copy the helloworld.dart file into your node.js server path, and copy the bits inside the <body> tag into your existing HTML page. You'll also need to copy the packages\browser\dart.js file somewhere to your node.js server, too.
If you wanted to run the JS version, you'd also need to use the editor menu option to Generate JavaScript and copy the .js files into your node.js server path.
The script tag that refers to dart.js automatically detects if the browser supports Dart natively, and will either load the .dart version of your app, or the .dart.js version of your app (from the same folder location).
So what you're likely after is something like:
c:/nodejs_server_root
/existingIndex.html // containing the two script tags from helloworld.html
// and other tags referred to in helloworld.dart
/helloworld.dart
/dart.js
/helloworld.dart.js
And in the "URL" path in the launch configuration, you'd put something like http://localhost:<port>/existingIndex.html
https://pub.dartlang.org/packages/dev_compiler can compile Dart to Node.js modules with the --modules=node option.
See also https://github.com/dart-lang/dev_compiler/issues/291#issuecomment-176687849