项目作者: andjo403

项目描述 :
a rust trace profiler that outputs to chrome trace-viewer format (chrome://tracing).
高级语言: Rust
项目地址: git://github.com/andjo403/rs_tracing.git
创建时间: 2018-03-24T21:08:24Z
项目社区:https://github.com/andjo403/rs_tracing

开源协议:MIT License

下载


Traces to Chrome’s trace_event format

Example

Cargo.toml:

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

main.rs:

  1. fn main() {
  2. open_trace_file!(".").unwrap();
  3. {
  4. trace_scoped!("complete","custom data":"main");
  5. trace_expr!("trace_expr", println!("trace_expr"));
  6. trace_begin!("duration");
  7. println!("trace_duration");
  8. trace_end!("duration");
  9. }
  10. close_trace_file!();
  11. }

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

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