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: StringSpan 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: StringDisplay name: "category title" or just "title".
cpu_duration: u64Raw 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: u64Concurrency-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: i64Start of span relative to parent start, in internal ticks.
end_relative_to_parent: i64End of span relative to parent start, in internal ticks.
args: Vec<(String, String)>Key-value attributes from the span.
is_aggregated: boolTrue 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: u64Total 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: u64Total bytes deallocated by this span and all its children. Group total for aggregated spans.
persistent_allocations: u64Sum 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: u64Number of allocation operations by this span and all its children. Group total for aggregated spans.
self_allocations: u64Bytes allocated by this span itself, excluding children. Group total for aggregated spans.
self_deallocations: u64Bytes 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: u64max(0, self_allocations - self_deallocations) for this span alone.
Group total for aggregated spans.
self_allocation_count: u64Number 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§
impl Freeze for SpanInfo
impl RefUnwindSafe for SpanInfo
impl Send for SpanInfo
impl Sync for SpanInfo
impl Unpin for SpanInfo
impl UnsafeUnpin for SpanInfo
impl UnwindSafe for SpanInfo
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
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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