pub struct StartupSpans<C: Clock = SystemClock> { /* private fields */ }Expand description
Named monotonic timestamps from a begin() epoch —
a shell records one named span at each startup milestone (see the
SPAN_* consts), then calls Self::emit_log once for a single
summary line.
Implementations§
Source§impl<C: Clock> StartupSpans<C>
impl<C: Clock> StartupSpans<C>
Sourcepub fn begin_with_enabled(clock: C, is_enabled: bool) -> Self
pub fn begin_with_enabled(clock: C, is_enabled: bool) -> Self
Test/advanced seam: begin with an explicit clock and enabled flag,
bypassing enabled’s cache (see FrameStats::new_enabled’s docs
for why).
Sourcepub fn record(&mut self, name: &'static str)
pub fn record(&mut self, name: &'static str)
Record name at the current clock reading, as a delta from
Self::begin’s epoch. A no-op (no clock read, no allocation) when
disabled.
Sourcepub fn record_duration(&mut self, name: &'static str, duration: Duration)
pub fn record_duration(&mut self, name: &'static str, duration: Duration)
Record name with an explicit duration, for a span measured
elsewhere (the first frame’s submit sub-spans, timed inside
frust-render, which cannot see this recorder).
Unlike Self::record the value is NOT an offset from the epoch: the
line prints it as-is, so first_submit_* fields read as milliseconds
spent, and the three sum to about the first frame’s submit span. They
are inserted between first_encode_done and first_frame_presented.
A no-op when disabled.