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 snapshot(&self) -> PerfSnapshot
pub fn snapshot(&self) -> PerfSnapshot
The readings as of now.
Trait Implementations§
Source§impl Debug for PerfMonitor
impl Debug for PerfMonitor
Auto Trait Implementations§
impl !Freeze for PerfMonitor
impl RefUnwindSafe for PerfMonitor
impl Send for PerfMonitor
impl Sync for PerfMonitor
impl Unpin for PerfMonitor
impl UnsafeUnpin for PerfMonitor
impl UnwindSafe for PerfMonitor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more