2 stable releases

Uses old Rust 2015

1.1.0 Dec 18, 2022
1.0.1 Jan 26, 2019

#95 in Profiling

Download history 866/week @ 2023-08-15 439/week @ 2023-08-22 415/week @ 2023-08-29 289/week @ 2023-09-05 264/week @ 2023-09-12 253/week @ 2023-09-19 189/week @ 2023-09-26 673/week @ 2023-10-03 337/week @ 2023-10-10 231/week @ 2023-10-17 228/week @ 2023-10-24 246/week @ 2023-10-31 289/week @ 2023-11-07 359/week @ 2023-11-14 314/week @ 2023-11-21 157/week @ 2023-11-28

1,199 downloads per month
Used in josh

MIT license

18KB
345 lines

Traces to Chrome's trace_event format

Example

Cargo.toml:

rs_tracing = { version = "1.0", features = ["rs_tracing"] }

main.rs:

fn main() {
    open_trace_file!(".").unwrap();
    {
        trace_scoped!("complete","custom data":"main");
        trace_expr!("trace_expr", println!("trace_expr"));
        trace_begin!("duration");
        println!("trace_duration");
        trace_end!("duration");
    }
    close_trace_file!();
}

also possible to add custom data to all the macros formated like the serde_json::json! macro e.g.

trace_scoped!("complete","custom":230,"more":"data");

lib.rs:

rs_tracing is a crate that outputs trace events to a file in the trace event format.

This format is used by chrome://tracing the output can also be converted to html with trace2html.

If the feature rs_tracing is not set in the toml file the macros expand to nothing, with the exception of trace_expr that will still execute the expression, also all crate dependencies of rs_tracing will be removed.

Dependencies

~0–265KB