Skip to main content

StartupTelemetry

Struct StartupTelemetry 

Source
pub struct StartupTelemetry { /* private fields */ }
Expand description

Zero-allocation monotonic nanosecond cold-start telemetry from process boot (t0) through first present (t7).

Implementations§

Source§

impl StartupTelemetry

Stage stamping and elapsed-millisecond breakdown helpers for StartupTelemetry.

Source

pub const fn with_boot_ns(t0_process_boot_ns: u64) -> Self

Creates a new StartupTelemetry anchored at process boot timestamp t0_process_boot_ns.

§Arguments
  • u64 - Monotonic process boot timestamp in nanoseconds.
§Returns
  • Self - Initialized telemetry record with t0_process_boot_ns stamped.
Source

pub fn elapsed_ms_between(start_ns: u64, end_ns: u64) -> Option<f64>

Computes a non-negative elapsed duration in milliseconds between two monotonic nanosecond timestamps.

§Arguments
  • u64 - Earlier monotonic timestamp in nanoseconds.
  • u64 - Later monotonic timestamp in nanoseconds.
§Returns
  • Option<f64> - Elapsed milliseconds when both timestamps are recorded (!= 0) and end_ns >= start_ns.
Source

pub fn record_stage_once( &mut self, stage: StartupStage, timestamp_ns: u64, ) -> bool

Records the first-observed monotonic nanosecond timestamp for stage without overwriting an existing stamp.

§Arguments
  • &Self - Mutable startup telemetry record.
  • StartupStage - Milestone stage being stamped.
  • u64 - Monotonic timestamp in nanoseconds.
§Returns
  • bool - true when the timestamp was recorded; false if timestamp_ns == 0 or the stage was already stamped.
Source

pub fn stage_timestamp_ns(&self, stage: StartupStage) -> Option<u64>

Returns the recorded nanosecond timestamp for stage, if set.

§Arguments
  • &Self - Startup telemetry reference.
  • StartupStage - Milestone stage to read.
§Returns
  • Option<u64> - Recorded timestamp in nanoseconds, or None when unset.
Source

pub fn is_complete(&self) -> bool

Returns true when both process boot (t0) and verified first present (t7) timestamps are recorded.

§Arguments
  • &Self - Startup telemetry reference.
§Returns
  • bool - true when full TTFF is available.
Source

pub fn total_ttff_ms(&self) -> Option<f64>

Returns total cold-start time-to-first-frame (t7 - t0) in milliseconds.

§Arguments
  • &Self - Startup telemetry reference.
§Returns
  • Option<f64> - Total TTFF in milliseconds.
Source

pub fn runtime_ready_ms(&self) -> Option<f64>

Returns runtime and renderer initialization duration (t1 - t0) in milliseconds.

§Arguments
  • &Self - Startup telemetry reference.
§Returns
  • Option<f64> - Runtime ready duration in milliseconds.
Source

pub fn font_ready_ms(&self) -> Option<f64>

Returns default font initialization duration (t2 - t1) in milliseconds.

§Arguments
  • &Self - Startup telemetry reference.
§Returns
  • Option<f64> - Font ready stage duration in milliseconds.
Source

pub fn mount_ms(&self) -> Option<f64>

Returns initial route scene mount duration (t3 - t2) in milliseconds.

§Arguments
  • &Self - Startup telemetry reference.
§Returns
  • Option<f64> - Initial mount duration in milliseconds.
Source

pub fn layout_ms(&self) -> Option<f64>

Returns initial layout pass duration (t4 - t3) in milliseconds.

§Arguments
  • &Self - Startup telemetry reference.
§Returns
  • Option<f64> - First layout pass duration in milliseconds.
Source

pub fn paint_ms(&self) -> Option<f64>

Returns initial display list paint and visible glyph upload duration (t5 - t4) in milliseconds.

§Arguments
  • &Self - Startup telemetry reference.
§Returns
  • Option<f64> - First paint stage duration in milliseconds.
Source

pub fn gpu_submit_ms(&self) -> Option<f64>

Returns first GPU/surface draw submission duration (t6 - t5) in milliseconds.

§Arguments
  • &Self - Startup telemetry reference.
§Returns
  • Option<f64> - First submit stage duration in milliseconds.
Source

pub fn first_present_ms(&self) -> Option<f64>

Returns verified first presentation latency (t7 - t6) in milliseconds.

§Arguments
  • &Self - Startup telemetry reference.
§Returns
  • Option<f64> - First present stage duration in milliseconds.
Source

pub fn elapsed_since_boot_ms(&self, stage: StartupStage) -> Option<f64>

Returns cumulative elapsed milliseconds from t0 to stage.

§Arguments
  • &Self - Startup telemetry reference.
  • StartupStage - Target milestone stage.
§Returns
  • Option<f64> - Elapsed milliseconds since t0_process_boot_ns.
Source§

impl StartupTelemetry

Source

pub fn get_t0_process_boot_ns(&self) -> u64

Source

pub fn get_mut_t0_process_boot_ns(&mut self) -> &mut u64

Source

pub fn set_t0_process_boot_ns(&mut self, val: u64) -> &mut Self

Source

pub fn get_t1_runtime_ready_ns(&self) -> u64

Source

pub fn get_mut_t1_runtime_ready_ns(&mut self) -> &mut u64

Source

pub fn set_t1_runtime_ready_ns(&mut self, val: u64) -> &mut Self

Source

pub fn get_t2_font_ready_ns(&self) -> u64

Source

pub fn get_mut_t2_font_ready_ns(&mut self) -> &mut u64

Source

pub fn set_t2_font_ready_ns(&mut self, val: u64) -> &mut Self

Source

pub fn get_t3_mount_done_ns(&self) -> u64

Source

pub fn get_mut_t3_mount_done_ns(&mut self) -> &mut u64

Source

pub fn set_t3_mount_done_ns(&mut self, val: u64) -> &mut Self

Source

pub fn get_t4_layout_done_ns(&self) -> u64

Source

pub fn get_mut_t4_layout_done_ns(&mut self) -> &mut u64

Source

pub fn set_t4_layout_done_ns(&mut self, val: u64) -> &mut Self

Source

pub fn get_t5_paint_done_ns(&self) -> u64

Source

pub fn get_mut_t5_paint_done_ns(&mut self) -> &mut u64

Source

pub fn set_t5_paint_done_ns(&mut self, val: u64) -> &mut Self

Source

pub fn get_t6_gpu_submit_ns(&self) -> u64

Source

pub fn get_mut_t6_gpu_submit_ns(&mut self) -> &mut u64

Source

pub fn set_t6_gpu_submit_ns(&mut self, val: u64) -> &mut Self

Source

pub fn get_t7_first_present_ns(&self) -> u64

Source

pub fn get_mut_t7_first_present_ns(&mut self) -> &mut u64

Source

pub fn set_t7_first_present_ns(&mut self, val: u64) -> &mut Self

Trait Implementations§

Source§

impl Clone for StartupTelemetry

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StartupTelemetry

Source§

impl Debug for StartupTelemetry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StartupTelemetry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for StartupTelemetry

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for StartupTelemetry

Source§

impl Hash for StartupTelemetry

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for StartupTelemetry

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for StartupTelemetry

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for StartupTelemetry

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.