Open arogowie-intel opened 3 years ago
If you are importing via a url you can add &title=<the title>
at the end:
https://github.com/jlfwong/speedscope#importing-via-url
To load a specific profile by URL, you can append a hash fragment like #profileURL=[URL-encoded profile URL]&title=[URL-encoded custom title]. Note that the server hosting the profile must have CORS configured to allow AJAX requests from speedscope.
@bjorn3 I'm working fully locally. The speedscope is running localy on my machine, as well as the recorded profile files are on my machine. Is there any way in such case to set the title?
I don't think so.
I second the need for this. The name of the loaded JSON file should show in the window title, and in the content somewhere.
I'm confused -- in both speedscope.app and when running locally via the npm installation of speedscope, I see the name of the file:
This works for me in both Arc & Chrome.
Here's the code that does that: https://github.com/jlfwong/speedscope/blob/0121cf93423033f41b42fc607ef076c7b8f8ac4e/src/views/application.tsx#L204
Can you provide reproduction instructions? Does this always happen for you or only via a specific import pathway? To check if you go to https://www.speedscope.app/ and click the "click here to load example profile", do you see the window title change?
The title is set from the name
value in the JSON. However, this may not be unique between JSON files, especially when comparing output from a tool, so the request here is to also include the filename in the UI somewhere.
Also note that browsers use document.title
to set the tab title, but those are often truncated (or not visible at all when there's only one tab), so showing the name + filename in the UI would improve things.
I see. For the vast majority of file types, the name will match the imported file name. For example, in the screenshots above, simple.txt
and perf-vertx-stacks-01-collapsed-all.txt
are both the filenames. Those files are plaintext files in the flamegraph format, not JSON, so the filename is the only reasonable choice of name. The name
value is only taken from the file content is specific situations where the name
was explicitly specified.
Can you share more about where these files are coming from that all end up with the same name (e.g. which profiler)? I'm wondering if there's a better upstream place to fix this problem. e.g. in speedscope's own file format, the name
field is optional, so if its just omitted, the behavior becomes what I think you're after: https://github.com/jlfwong/speedscope/blob/0121cf93423033f41b42fc607ef076c7b8f8ac4e/src/lib/file-format-spec.ts#L17-L20
Regarding showing in the UI, speedscope also already does that (see top middle):
Hi,
I need to compare multiple recorded profiling sessions and it would be much more convenient for me if there would be app window title set to loaded file name. Currently unfortunately I can't see any window title set. There is only information about what thread is displayed in the middle of the top bar.
I'm using: