#[non_exhaustive]pub struct SpanRecord {
pub id: SpanId,
pub parent: Option<SpanId>,
pub node: Option<NodeId>,
pub task: String,
pub kind: SpanKind,
pub start: Duration,
pub end: Duration,
pub outcome: Outcome,
pub stats: Stats,
}Expand description
One finished span.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: SpanIdThis span’s identity.
parent: Option<SpanId>The enclosing span, for spans made with Span::child.
node: Option<NodeId>The progress-tree phase this span belongs to, if any.
task: StringThe task’s label: a logical task, chunk or attempt, not an OS thread.
kind: SpanKindWhat the span measures.
start: DurationStart, in the clock’s epoch.
end: DurationEnd, in the clock’s epoch.
outcome: OutcomeHow the span ended; a dropped span records Abandoned.
stats: StatsCheckpoint evidence.
Implementations§
Source§impl SpanRecord
impl SpanRecord
Sourcepub fn elapsed(&self) -> Duration
pub fn elapsed(&self) -> Duration
Wall time from start to end, including nested spans. Do not add a parent’s time to its children’s.
Sourcepub fn checks_per_second(&self) -> f64
pub fn checks_per_second(&self) -> f64
Checks per second of this span’s wall time.
Sourcepub fn is_poll_storm(&self, minimum_checks: u64, checks_per_second: f64) -> bool
pub fn is_poll_storm(&self, minimum_checks: u64, checks_per_second: f64) -> bool
Whether this span made at least minimum_checks checks at more than
checks_per_second. A high rate alone does not prove waste.
Trait Implementations§
Source§impl Clone for SpanRecord
impl Clone for SpanRecord
Auto Trait Implementations§
impl Freeze for SpanRecord
impl RefUnwindSafe for SpanRecord
impl Send for SpanRecord
impl Sync for SpanRecord
impl Unpin for SpanRecord
impl UnsafeUnpin for SpanRecord
impl UnwindSafe for SpanRecord
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