#profiling #tracing #flamegraph #subscriber

tracing-chrome

A Layer for tracing-subscriber that outputs Chrome-style traces

8 releases (breaking)

0.7.0 Nov 15, 2022
0.6.0 Apr 23, 2022
0.5.0 Mar 24, 2022
0.4.0 Nov 11, 2021
0.1.0 Aug 20, 2020

#40 in Profiling

Download history 15441/week @ 2022-08-15 6858/week @ 2022-08-22 6478/week @ 2022-08-29 7164/week @ 2022-09-05 7365/week @ 2022-09-12 5338/week @ 2022-09-19 8420/week @ 2022-09-26 11417/week @ 2022-10-03 12700/week @ 2022-10-10 12083/week @ 2022-10-17 11511/week @ 2022-10-24 12266/week @ 2022-10-31 9661/week @ 2022-11-07 10352/week @ 2022-11-14 8059/week @ 2022-11-21 8686/week @ 2022-11-28

37,802 downloads per month
Used in 17 crates (14 directly)

MIT license

55KB
463 lines

tracing-chrome

Crates.io Documentation GitHub CI

Overview

tracing-chrome is a Layer for tracing-subscriber that outputs traces in Chrome's trace viewer format that can be viewed with chrome://tracing or ui.perfetto.dev.

Usage

Add this near the beginning of main:

use tracing_chrome::ChromeLayerBuilder;
use tracing_subscriber::{registry::Registry, prelude::*};

let (chrome_layer, _guard) = ChromeLayerBuilder::new().build();
tracing_subscriber::registry().with(chrome_layer).init();

When _guard is dropped, your trace will be in a file like trace-1668480819035032.json.

Open that file with ui.perfetto.dev (or chrome://tracing) and take a look at your pretty trace.

License

Licensed under the MIT license

Contributions

Unless you state otherwise, any contribution intentionally submitted for inclusion in the work shall be licensed as above.

Dependencies

~1.5MB
~27K SLoC