pub struct Trace {
pub spans: Vec<Span>,
pub duration: Option<Duration>,
pub config: TraceConfig,
}Expand description
Collected trace data
Fields§
§spans: Vec<Span>Collected spans
duration: Option<Duration>Total trace duration
config: TraceConfigConfiguration used
Implementations§
Source§impl Trace
impl Trace
Sourcepub fn span_count(&self) -> usize
pub fn span_count(&self) -> usize
Get span count
Sourcepub fn spans_by_name(&self, name: &str) -> Vec<&Span>
pub fn spans_by_name(&self, name: &str) -> Vec<&Span>
Get spans by name
Sourcepub fn root_spans(&self) -> Vec<&Span>
pub fn root_spans(&self) -> Vec<&Span>
Get root spans (no parent)
Sourcepub fn statistics_for(&self, name: &str) -> Option<Statistics>
pub fn statistics_for(&self, name: &str) -> Option<Statistics>
Calculate statistics for a span name
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Trace
impl<'de> Deserialize<'de> for Trace
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Trace
impl RefUnwindSafe for Trace
impl Send for Trace
impl Sync for Trace
impl Unpin for Trace
impl UnsafeUnpin for Trace
impl UnwindSafe for Trace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more