1 stable release

Uses old Rust 2015

1.0.1 Jan 26, 2019

#79 in Profiling

Download history 102/week @ 2021-08-09 89/week @ 2021-08-16 79/week @ 2021-08-23 123/week @ 2021-08-30 134/week @ 2021-09-06 146/week @ 2021-09-13 102/week @ 2021-09-20 87/week @ 2021-09-27 184/week @ 2021-10-04 129/week @ 2021-10-11 134/week @ 2021-10-18 92/week @ 2021-10-25 97/week @ 2021-11-01 198/week @ 2021-11-08 172/week @ 2021-11-15 147/week @ 2021-11-22

624 downloads per month
Used in josh

MIT license

18KB
351 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–290KB