pub struct PerfMonitor { /* private fields */ }Expand description
Collects a surface’s frame and commit timings. Shared by its engine
thread and its main thread (Arc); see the module documentation.
Implementations§
Source§impl PerfMonitor
impl PerfMonitor
Sourcepub fn new() -> PerfMonitor
pub fn new() -> PerfMonitor
An empty monitor.
Sourcepub fn record_work(&self, cost: Duration, dirty: bool)
pub fn record_work(&self, cost: Duration, dirty: bool)
Main thread: cost was spent on the surface; dirty if it changed
what the screen shows (a batch was applied, an animation stepped, a
scroll view moved).
Sourcepub fn vsync(&self, at: Instant, interval: Duration)
pub fn vsync(&self, at: Instant, interval: Duration)
Main thread: the display refreshed at at, interval after the
previous refresh (the display link’s period). Closes the frame the
work since the previous refresh belongs to.
Sourcepub fn record_latency(&self, latency: Duration)
pub fn record_latency(&self, latency: Duration)
Main thread: a batch was applied latency after the engine handed
it over.
Sourcepub fn record_commit(&self, timing: CommitTiming)
pub fn record_commit(&self, timing: CommitTiming)
Engine thread: a wake-up that committed.
Sourcepub fn record_busy(&self, busy: Duration)
pub fn record_busy(&self, busy: Duration)
Engine thread: a wake-up was busy for busy.
Sourcepub fn set_process(&self, sample: ProcessSample)
pub fn set_process(&self, sample: ProcessSample)
Stores the process’ latest resource use (ProcessSampler), shown
with the next snapshots.
Sourcepub fn set_memory(&self, sample: MemorySample)
pub fn set_memory(&self, sample: MemorySample)
Engine thread: what the app holds, shown with the next snapshots.
Sourcepub fn snapshot(&self) -> PerfSnapshot
pub fn snapshot(&self) -> PerfSnapshot
The readings as of now.