Skip to main content

duration_span

Macro duration_span 

Source
macro_rules! duration_span {
    ($name:literal) => { ... };
    ($name:literal, $($arg:tt)+) => { ... };
}
Expand description

Creates a event-based span that traces a certain duration (lifetime of the guard). It’s not a real span, which means it can be used across threads.

It will trace a duration and not the time the cpu is doing actual work. This way it can be used to trace non-cpu-time or time that is spend in other processes.

Set blocking = true for waiting (for example, network I/O or a pool slot). The trace server preserves the elapsed range but excludes its own duration from CPU time, concurrency and corrected-time accounting, like an entered span with the same attribute. Counted child work is unaffected. Use blocking = false for work performed by another thread or process; omitting the attribute also retains this counted behavior for compatibility. Such durations approximate external work, not measured process CPU time.