10 releases (6 breaking)

new 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

#7 in Profiling

Download history 26973/week @ 2023-11-27 30597/week @ 2023-12-04 24048/week @ 2023-12-11 21898/week @ 2023-12-18 11880/week @ 2023-12-25 27625/week @ 2024-01-01 24787/week @ 2024-01-08 34223/week @ 2024-01-15 27365/week @ 2024-01-22 32691/week @ 2024-01-29 32228/week @ 2024-02-05 24216/week @ 2024-02-12 23229/week @ 2024-02-19 21108/week @ 2024-02-26 30600/week @ 2024-03-04 13271/week @ 2024-03-11

89,900 downloads per month
Used in 54 crates (32 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–2MB
~36K SLoC