pub struct ExecutionTrace {
pub trace_id: String,
/* private fields */
}Expand description
An execution trace that collects spans for a single workflow run.
Fields§
§trace_id: StringUnique trace identifier (typically the workflow run ID).
Implementations§
Source§impl ExecutionTrace
impl ExecutionTrace
Sourcepub fn start_span(
&mut self,
id: SpanId,
name: impl Into<String>,
) -> &mut TraceSpan
pub fn start_span( &mut self, id: SpanId, name: impl Into<String>, ) -> &mut TraceSpan
Start a new root span.
§Panics
This method will not panic; if the internal map entry is somehow
missing after insertion the returned reference is obtained via
Entry::or_insert_with, guaranteeing it exists.
Sourcepub fn start_child_span(
&mut self,
id: SpanId,
parent: &SpanId,
name: impl Into<String>,
) -> &mut TraceSpan
pub fn start_child_span( &mut self, id: SpanId, parent: &SpanId, name: impl Into<String>, ) -> &mut TraceSpan
Sourcepub fn finish_span(&mut self, id: &SpanId, status: SpanStatus)
pub fn finish_span(&mut self, id: &SpanId, status: SpanStatus)
Finish a span with the given status.
Sourcepub fn spans_ordered(&self) -> Vec<&TraceSpan>
pub fn spans_ordered(&self) -> Vec<&TraceSpan>
Get all spans in creation order.
Sourcepub fn root_spans(&self) -> Vec<&TraceSpan>
pub fn root_spans(&self) -> Vec<&TraceSpan>
Get only root spans (those without a parent).
Sourcepub fn children_of(&self, parent: &SpanId) -> Vec<&TraceSpan>
pub fn children_of(&self, parent: &SpanId) -> Vec<&TraceSpan>
Get all children of a given span.
Sourcepub fn span_count(&self) -> usize
pub fn span_count(&self) -> usize
Return how many spans are in this trace.
Sourcepub fn running_count(&self) -> usize
pub fn running_count(&self) -> usize
Return how many spans are still running.
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Return how many spans failed.
Sourcepub fn total_duration(&self) -> Option<Duration>
pub fn total_duration(&self) -> Option<Duration>
Compute total trace duration (from earliest start to latest end).
Sourcepub fn summary(&self) -> TraceSummary
pub fn summary(&self) -> TraceSummary
Generate a simple summary of the trace.
Trait Implementations§
Source§impl Clone for ExecutionTrace
impl Clone for ExecutionTrace
Source§fn clone(&self) -> ExecutionTrace
fn clone(&self) -> ExecutionTrace
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ExecutionTrace
impl RefUnwindSafe for ExecutionTrace
impl Send for ExecutionTrace
impl Sync for ExecutionTrace
impl Unpin for ExecutionTrace
impl UnsafeUnpin for ExecutionTrace
impl UnwindSafe for ExecutionTrace
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