How tracing should be configured.
Stores the relevant data about a sample for later serialization.
The payload associated with any sample is by default a string but may be
configured via the
Stores the tracing data.
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
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.
Creates a duration sample that measures how long the closure took to execute.
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