Skip to content

Add render/show_logs to chrome_trace #540

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

Merged
merged 8 commits into from
Jul 8, 2024

Conversation

m-fila
Copy link
Contributor

@m-fila m-fila commented Jul 2, 2024

Chrome tracing is a fairly popular tool for working with traces and process timelines. The traces can be not only displayed but also analyzed and queried with SQL

The Dagger logs can be transformed to a chrome-trace schema json format. The resulting json file can be loaded to https://ui.perfetto.dev/ or legacy about:tracing in a chrome-based browser

Dagger.enable_logging!(tasknames=true)
...
logs = Dagger.fetch_logs!()
open("chr_trace.json", "w") do io
    Dagger.show_logs(io, logs, :chrome_trace)
end

This can be considered an alternative to the in-house :plots_gantt


Example output (json file):

perfetto

For comparison, the same logs printed with :plots_gantt

gantt


Optional dependency on JSON3 is added, but it's used only to get a json-string from a Dict so it should be possible to easily replace it with any other JSON library in case you have a preference

For now only :compute events are used (same as in :plots_gantt) but it should be possible to add support for other types of evetns too

@jpsamaroo
Copy link
Member

Sorry for the delay - this is really cool! I'll review this soon, it looks already really good ❤️

Copy link
Member

@jpsamaroo jpsamaroo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful work! I think I'll plan to recommend this when users submit bugs/performance issues.

Just a few desired tweaks, and I'd be happy to merge this 😄

@jpsamaroo jpsamaroo merged commit 464601d into JuliaParallel:master Jul 8, 2024
9 of 12 checks passed
@jpsamaroo
Copy link
Member

Thanks so much @m-fila !

@m-fila m-fila deleted the chrome_trace_logs branch July 16, 2024 14:25
davidizzle pushed a commit to davidizzle/Dagger.jl that referenced this pull request Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants