Skip to main content

Module trace

Module trace 

Source
Expand description

Performance tracing support for the --generateTrace flag.

Generates Chrome DevTools compatible trace files that can be loaded in chrome://tracing or the Perfetto UI (https://ui.perfetto.dev/).

§Trace Format

The trace file is a JSON array of trace events following the Chrome Trace Event Format specification.

§Usage

use tsz::cli::trace::Tracer;

let mut tracer = Tracer::new();
tracer.begin("Parse", "file.ts");
// ... do parsing ...
tracer.end("Parse", "file.ts");
tracer.write_to_file("trace/trace.json")?;

Modules§

categories
Categories for trace events

Structs§

TraceEvent
A single trace event
TraceSpan
RAII guard for tracing a span
Tracer
Performance tracer that collects timing information

Enums§

Phase
Trace event phases (Chrome Trace Event Format)