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 json_payload feature (there is an
associated performance hit across the board for turning it on).
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.
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 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.