pub struct FrameStats { /* private fields */ }Expand description
Pure rolling frame-time accumulator. Fed explicit deltas (seconds); holds no clock, so it is fully unit-testable. Fixed capacity — no per-frame alloc.
Implementations§
Source§impl FrameStats
impl FrameStats
Sourcepub fn record(&mut self, dt_secs: f32)
pub fn record(&mut self, dt_secs: f32)
Record one frame’s duration (seconds) into the ring and bump the total.
Sourcepub fn record_dropped(&mut self)
pub fn record_dropped(&mut self)
Count a frame the renderer could not present (surface acquire skip).
Sourcepub fn fps(&self) -> f32
pub fn fps(&self) -> f32
Frames per second over the retained window (0 until the first sample).
Sourcepub fn frame_ms_avg(&self) -> f32
pub fn frame_ms_avg(&self) -> f32
Mean frame time over the window, in milliseconds.
Sourcepub fn frame_ms_p99(&self) -> f32
pub fn frame_ms_p99(&self) -> f32
99th-percentile frame time over the window, in milliseconds.
Sourcepub fn frame_ms_p50(&self) -> f32
pub fn frame_ms_p50(&self) -> f32
Median frame time over the window, in milliseconds.
The pair with frame_ms_p99 is what makes a
frame-time reading legible: the median says what a typical frame costs and
the p99 says what the worst ones do, and a mean sits between them saying
neither. Native-only, like the analysis snapshot beside it — it is not on
Metrics, which mirrors the C ABI’s RlxMetrics and cannot grow a
field without widening that surface (ADR-0052’s split).
Sourcepub fn frames_total(&self) -> u64
pub fn frames_total(&self) -> u64
Frames recorded since creation.
Sourcepub fn frames_dropped(&self) -> u64
pub fn frames_dropped(&self) -> u64
Frames the renderer skipped.