Skip to main content

SpanInfo

Struct SpanInfo 

Source
pub struct SpanInfo {
Show 26 fields pub id: String, pub name: String, pub cpu_duration: u64, pub corrected_duration: u64, pub start_relative_to_parent: i64, pub end_relative_to_parent: i64, pub args: Vec<(String, String)>, pub is_aggregated: bool, pub count: Option<u64>, pub total_cpu_duration: Option<u64>, pub avg_cpu_duration: Option<u64>, pub total_corrected_duration: Option<u64>, pub avg_corrected_duration: Option<u64>, pub first_span_id: Option<String>, pub heaviest_span_id: Option<String>, pub allocations: u64, pub deallocations: u64, pub persistent_allocations: u64, pub allocation_count: u64, pub self_allocations: u64, pub self_deallocations: u64, pub self_persistent_allocations: u64, pub self_allocation_count: u64, pub memory_samples: Vec<(i64, u64, u8, u64, u64)>, pub memory_summary: Option<MemorySummary>, pub children: Vec<SpanInfo>,
}
Expand description

Information about a single span (or aggregated group of spans).

Fields§

§id: String

Span ID string.

The format encodes both the type and the navigation path:

  • A raw span leaf is its decimal index: "123".
  • An aggregated span leaf is "a" + the first-span index: "a123".
  • When the span is a child of another span, the parent’s ID is prepended with a dash separator, e.g. "a5-a34" or "1-a5-a34-20".

Pass the full ID as the parent option of the next query_spans call to enumerate the children of that span.

§name: String

Display name: "category title" or just "title".

§cpu_duration: u64

Raw CPU total time in internal ticks (100 ticks = 1 µs). For aggregated spans, this is the first (example) span’s value, not the group total. See total_cpu_duration for the group total.

§corrected_duration: u64

Concurrency-corrected total time in internal ticks. For aggregated spans, this is the first (example) span’s value, not the group total. See total_corrected_duration for the group total.

§start_relative_to_parent: i64

Start of span relative to parent start, in internal ticks.

§end_relative_to_parent: i64

End of span relative to parent start, in internal ticks.

§args: Vec<(String, String)>

Key-value attributes from the span.

§is_aggregated: bool

True if this entry represents an aggregated group of spans.

§count: Option<u64>

Number of spans in the group (only set for aggregated spans).

§total_cpu_duration: Option<u64>

Sum of cpu_duration across all spans in the group.

§avg_cpu_duration: Option<u64>

Average cpu_duration across all spans in the group.

§total_corrected_duration: Option<u64>

Sum of corrected_duration across all spans in the group.

§avg_corrected_duration: Option<u64>

Average corrected_duration across all spans in the group.

§first_span_id: Option<String>

Raw span ID of the group’s example span, whose cpu_duration, corrected_duration and memory_samples are the ones reported above. First in execution order — not the largest, so it can badly understate a group’s allocations. Use heaviest_span_id for those.

§heaviest_span_id: Option<String>

Raw span ID of the group member with the largest total_persistent_allocations.

§allocations: u64

Total bytes allocated by this span and all its children.

For aggregated groups this is the group total, unlike cpu_duration, corrected_duration and memory_samples, which describe the example span only. Every allocation field below follows this field, not those.

§deallocations: u64

Total bytes deallocated by this span and all its children. Group total for aggregated spans.

§persistent_allocations: u64

Sum over each span of max(0, self_allocations - self_deallocations), for this span and its children. Group total for aggregated spans.

A ranking signal, not retained memory. TurboMalloc’s per-span counters never see memory released outside the allocating span’s window — turbo-tasks cell and cache drops in particular — so a whole-trace total far above real peak RSS is expected, not a leak. Use memory_summary for absolute memory.

The per-span floor at zero is also why this is not allocations - deallocations.

§allocation_count: u64

Number of allocation operations by this span and all its children. Group total for aggregated spans.

§self_allocations: u64

Bytes allocated by this span itself, excluding children. Group total for aggregated spans.

§self_deallocations: u64

Bytes deallocated by this span itself, excluding children. Group total for aggregated spans.

Frees are charged to whichever span was on top of the thread’s stack at free time, which is often not the span that allocated. So small self_allocations with large self_deallocations means this span is where a child’s arena gets dropped — that arena is bounded, not leaking. The shape to suspect is a large self_persistent_allocations with no such counterpart above it.

§self_persistent_allocations: u64

max(0, self_allocations - self_deallocations) for this span alone. Group total for aggregated spans.

§self_allocation_count: u64

Number of allocation operations by this span itself, excluding children. Group total for aggregated spans.

§memory_samples: Vec<(i64, u64, u8, u64, u64)>

Process samples recorded while this span (or its example span, for aggregated groups) was live.

Process-wide, not per-span. There is one global sample series, and a span’s samples are just the slice covering its time range, so spans that overlap in time report identical values no matter what each allocated. Rank concurrent work by the allocation fields; use these for absolute memory over a span that dominates its window.

Each tuple is (ts_offset_from_span_start_in_ticks, bytes, pressure, footprint, active_worker_threads). bytes is TurboMalloc memory usage; pressure is the memory-pressure byte (0 = no pressure, higher = more pressure); footprint is the process memory footprint (RSS) in bytes (0 = not reported by the platform); and active_worker_threads counts non-parked Tokio scheduler workers. 100 ticks = 1 µs. The offset is within the span.

The store caps the series at MAX_MEMORY_SAMPLES; when more samples exist in the range, consecutive groups are merged: the timestamp and value come from the group’s max-memory sample, while pressure, footprint and worker count are each the max over the group.

§memory_summary: Option<MemorySummary>

Summary of memory_samples. None when the span’s range holds none.

§children: Vec<SpanInfo>

Descendants of this span, populated only when QueryOptions::depth is greater than 1. Sorted and aggregated the same way as this level.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> MaybeSendSync for T

§

impl<T> MaybeTypeTag for T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more