Disable tracing. This clears all trace data (& frees the memory).
Enable tracing with the default configuration. See Config::default.
Tracing is disabled initially on program launch.
Enable tracing with a specific configuration. Tracing is disabled initially
on program launch.
Is tracing enabled. Technically doesn’t guarantee any samples will be
stored as tracing could still be enabled but set with a limit of 0.
Returns all the samples collected so far ordered chronologically by
creation. Roughly corresponds to start_ns but instead there’s a
monotonically increasing single global integer (when tracing) per creation
of Sample that determines order.
Returns all the samples collected so far. There is no guarantee that the
samples are ordered chronologically for several reasons:
Save tracing data to to supplied path, using the Trace Viewer format. Trace file can be opened
using the Chrome browser by visiting the URL about:tracing
. If sorted_chronologically
is
true then sort output traces chronologically by each trace’s time of creation.
Create an instantaneous sample without any payload. This is the lowest
overhead tracing routine available.
Creates a duration sample. The sample is finalized (end_ns set) when the
returned value is dropped. trace_closure
may be prettier to read.
See trace_block
for how the block works and trace_payload
for a
discussion on payload.
Creates a duration sample that measures how long the closure took to execute.
See trace_closure
for how the closure works and trace_payload
for a
discussion on payload.
Create an instantaneous sample with a payload. The type the payload
conforms to is currently determined by the feature this library is compiled
with. By default, the type is string-like just like name. If compiled with
the json_payload
then a serde_json::Value
is expected and the library
acquires a dependency on the serde_json
crate.