[][src]Crate xi_trace

Modules

chrome_trace_dump

Structs

Config

How tracing should be configured.

Sample

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

SampleArgs
SampleGuard
Trace

Stores the tracing data.

Enums

CategoriesT
SampleEventType

Functions

disable_tracing

Disable tracing. This clears all trace data (& frees the memory).

enable_tracing

Enable tracing with the default configuration. See Config::default. Tracing is disabled initially on program launch.

enable_tracing_with_config

Enable tracing with a specific configuration. Tracing is disabled initially on program launch.

is_enabled

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.

samples_cloned_sorted

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.

samples_cloned_unsorted

Returns all the samples collected so far. There is no guarantee that the samples are ordered chronologically for several reasons:

samples_len
trace

Create an instantaneous sample without any payload. This is the lowest overhead tracing routine available.

trace_block

Creates a duration sample. The sample is finalized (end_ns set) when the returned value is dropped. trace_closure may be prettier to read.

trace_block_payload

See trace_block for how the block works and trace_payload for a discussion on payload.

trace_closure

Creates a duration sample that measures how long the closure took to execute.

trace_closure_payload

See trace_closure for how the closure works and trace_payload for a discussion on payload.

trace_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 dict_payload then a Rust HashMap is expected while the json_payload feature makes the payload a serde_json::Value (additionally the library acquires a dependency on the serde_json crate.

Type Definitions

StrCow
TracePayloadT