pub struct PassStats { /* private fields */ }Expand description
Per-pass GPU cost over a rolling window of frames.
Fed one FrameTimings a frame — the same latent report the debug overlay
reads — and read at the end of a run, or whenever a caller wants to know
what a pass normally costs rather than what it cost once. See the module
docs.
Implementations§
Source§impl PassStats
impl PassStats
Sourcepub fn record(&mut self, timings: &FrameTimings) -> bool
pub fn record(&mut self, timings: &FrameTimings) -> bool
Records one frame’s per-pass costs, ignoring a report already recorded.
Reports whether it was a new frame. An empty report — a device with no timestamps, or a ring that has not come round yet — is not one.
Sourcepub fn labels(&self) -> impl Iterator<Item = &str>
pub fn labels(&self) -> impl Iterator<Item = &str>
The labels seen, in the order they were first seen.
Sourcepub fn percentiles(&self, label: &str) -> Option<(u64, u64)>
pub fn percentiles(&self, label: &str) -> Option<(u64, u64)>
One pass’s p50 and p95 in nanoseconds, or None when the label is
unknown or its window is below MIN_PERCENTILE_SAMPLES.
Sourcepub fn p50_total_nanos(&self) -> u64
pub fn p50_total_nanos(&self) -> u64
The sum of every pass’s p50.
Not the p50 of the frame — that is crcbl_ui::BudgetStats’s
number, taken over the totals themselves. This is what the rows add up
to, which is what the share column is a share of, and the two differ by
however much the passes’ slow frames fail to line up.
Sourcepub fn report(&self) -> String
pub fn report(&self) -> String
The report, as text.
The distribution counterpart of FrameTimings::report: that says what
one frame cost, this says what a pass normally costs and how far its tail
runs.