10 releases (6 breaking)

0.7.2 Mar 15, 2024
0.7.1 Feb 17, 2023
0.7.0 Nov 15, 2022
0.6.0 Apr 23, 2022
0.2.0 Sep 5, 2020

#9 in Profiling

Download history 85956/week @ 2024-08-18 56936/week @ 2024-08-25 62660/week @ 2024-09-01 65055/week @ 2024-09-08 57669/week @ 2024-09-15 60454/week @ 2024-09-22 66018/week @ 2024-09-29 73178/week @ 2024-10-06 65074/week @ 2024-10-13 66359/week @ 2024-10-20 68961/week @ 2024-10-27 68272/week @ 2024-11-03 67981/week @ 2024-11-10 72811/week @ 2024-11-17 69468/week @ 2024-11-24 82123/week @ 2024-12-01

298,643 downloads per month
Used in 111 crates (49 directly)

MIT license

24KB
459 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.4–2.2MB
~39K SLoC