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.
Sourcepub fn offset_of(&self, name: &str) -> Option<Duration>
pub fn offset_of(&self, name: &str) -> Option<Duration>
The recorded offset of the first span called name, if any.
Sourcepub fn record_install_steps(
&mut self,
steps: &InstallSteps,
start_ref: Option<&str>,
)
pub fn record_install_steps( &mut self, steps: &InstallSteps, start_ref: Option<&str>, )
Record every install sub-step as a duration. With start_ref, also
record SPAN_RENDER_THREAD_START_MS: the start_ref to
adapter_ready gap less the install’s own total (call after
adapter_ready is recorded; skipped when either span is missing).
Sourcepub fn record_font_steps(&mut self, font_system: Duration, app_sync: Duration)
pub fn record_font_steps(&mut self, font_system: Duration, app_sync: Duration)
Record the two TextContext::new halves as durations.