How to view flamegraph .cpuprofile files - nsolid

I'm comparing the cpu profile on a couple of branches of my app, and I have downloaded the .cpuprofile files from the console. I'd like to compare them side-by-side but I'm not clear on how to open the saved files.

UPDATE:
Flamegraph
Web version - http://thlorenz.com/flamegraph/web/
Source Code - https://github.com/thlorenz/flamegraph
You can provide a .cpuprofile file using --inputtype cpuprofile
Chrome Dev Tools
.cpuprofile files are Google CPU Profiler Binary Data Files, N|Solid Console offer download the profiling information in this format. This format can we readed by some perfomance tools, also can be viewed on Chrome Developer Tools.
Under "Profiles" tab you can click on the "Load" button and provide the .cpuprofile file.
There is a similar question here with a good answer.

VS Code has an integrated visualizer that supports viewing JavaScript .cpuprofile and .heapprofile files.
It provides the following views:
Table view
Flame view
Left-heavy view

Related

Can azure jupyterlab vscode open Rmd files?

Microsoft's Azure claims to offer integration with jupyterlab, which I would be quite keen to use (editing code in a browser really starts to irritate one after a while). However, I am using Rmd files in jupyterlab so as to maintain the notebooks in git.
When I tried to connect to jupyterlab from azure by clicking the "open in vscode" button I just got an editor for the Rmd file itself which didn't seem very helpful.
Is there a way of using Rmd files in jupyterlab with vscode? (preferrably without a whole bunch of exporting and importing using e.g. jupytext)

Can I access Electron's HTML/CSS via app.asar?

I'm testing a desktop app being built in Electron. Since the app’s layout is CSS/HTML based, I was hoping to do simple layout modifications without access to the source material. Even if I can't see my mods in the running app, it would be useful to extract HTML/CSS/JavaScript templates, modify these and see the results in a browser.
Question 1: Is the above possible?
Based on this question I'm assuming app.asar could be what I'm looking for, but being on Windows 10, it seems that installing asar (and Node, NPM, Python and Visual Studio) just to unarchive files is discouraged.
Question 2: Can I access the files presumed to be inside app.asar without installing all the stuff mentioned above?

How to open an sshfs-project in Adobe Brackets editor

adobe-brackets is an open source code editor for the web, written in JavaScript, HTML and CSS.
Although I followed the instructions on how to open a Project ( see also How to create a new project in adobe-brackets?) this does not work for my project-directory which is mapped via sshfs.
Brackets will show the sshfs directory but without any contents. (neither files nor subdirs)
Opening other locally stored directories works like a charm.
Any hints/suggestions?
Update: This is fixed in the latest release of Brackets, Sprint 34. You should now be able to open files on SSHFS file systems with no trouble.
original answer:
What platform are you on? If Linux, you might be seeing bug #5292, which is currently under investigation.
If not, it might be best if you just file a new bug specifying your platform and any other details, and then the Brackets devs (of which I am one) can take a look. When reporting a bug, always check the console log via Debug > Show Developer Tools and paste any exceptions there into your bug report.

Google Chrome file system api: bug in sample code?

I am trying to run this example code:
https://github.com/GoogleChrome/chrome-app-samples/tree/master/filesystem-access
as well as this:
https://github.com/GoogleChrome/chrome-app-samples/tree/master/storage
I am not able to get either of them to run in my browser: Chrome 26.0.1410.65 Mac Lion 10.7.5
(to see it run, download it and click on html page included with each of the examples)
If you can confirm this is a bug in the sample code (it doesn't run in your system as well) please let me know where I should file this bug report. (https://code.google.com/p/chromium/ or https://github.com/GoogleChrome/chrome-app-samples/issues?)
many thanks in advance.
You need to use the Load unpacked extension button found on the chrome://extensions page and then launch the app in order for it to use chrome.* API's.

Installing print driver on Windows Azure VM

We have a native, stand alone Win32 application that we use to generate .PDF files. It is command line driven to take one of our data files in and generate a PDF file. It works in conjunction with a print driver that is installed on the computer.
I know there are libraries for generating PDF files in .NET that we can use in Azure, however, there is specific type layout being carried out in our App that we must support, and that logic is not yet on the server side. This is a short term cheat, before we port (or rewrite) our 20 year old type layout engine out of C/C++. There is alot of code here with alot of complexity.
I see that we can now run native apps in Azure (yay). However, my issue seems to be that this native application requires a print driver installed. I have not been able to find any information about installing print driver in Azure worker role.
I found this discussion: https://stackoverflow.com/questions/9125385/printing-to-pdf-from-azure-worker-role. The end result of this is to use a PDF library on Azure, which is not something that will work for us.
Also, I am aware that it is not the best use of a server to fire up a process to generate a PDF file everytime somebody wants to preview their data file in our web site. We are planning on cheating by showing the user the PDF, when they want to preview our proprietary data format in a browser. This is Phase I of a project, and rewriting our 20 year old type layout engine in C# is going to take alot longer to accomplish, and we are talking about this (admitted hack) as a short term (in the bigger sense of things) measure.
How do I install a Print Driver in Windows Azure worker role? Is it possible? Are there any other options?
Many Thanks.
If you can do a command line, silent install of the Amyuni software that yms mentioned then you could run that as part of a startup task on your worker role, probably with elevated permissions. People use startup tasks to do all sorts of things and many of them have written blog posts about it or answer questions about them here on SO, but a good place to start would be the official documentation.
This may help: Amyuni PDF Converter is a PDF printer driver with an API exposed as a COM interface and as a net. assembly that allows you to silently install and uninstall the driver programmatically. This can be done by using the methods PDFDriverInit and DriverEnd from your application.
Once your application installs the driver, you can print to PDF using a memory stream as destination and upload it to a Microsoft Azure Blob Storage.
There are 2 ways of installing Amyuni PDF Converter:
1- Using the installation program provided with the package.
2- Copying the dll files to their corresponding folders and then calling the method DriverInit.
The complete process is explained here:
Using the Developer Version of the Amyuni Document Converter
About your specific scenario, if you have an application that uses Amyuni PDF Converter, then there is indeed a printer driver that should be installed with it. Your application could be installing the driver every time it is launched and removing it when it is closed, or it could be installing it only during the installation of your program.
If you do not have the source code of this application but you still have the license information of the library provided by Amyuni, you could try building a small application or batch script that just takes care of the installation process. You can contact Amyuni support for a link to the latest build of the version you are using.
You mentioned that you are using Windows Azure VM, so I am assuming that you have administrative rights on the virtual system and that you can connect to it using remote desktop and run any kind of applications.
Usual disclaimer applies