pub struct PerformanceMetrics { /* private fields */ }Expand description
Performance metrics collector
Implementations§
Source§impl PerformanceMetrics
impl PerformanceMetrics
Sourcepub fn with_capacity(max_frames: usize) -> Self
pub fn with_capacity(max_frames: usize) -> Self
Create with a specific frame buffer capacity
Sourcepub fn start_frame(&mut self)
pub fn start_frame(&mut self)
Start measuring a new frame
Sourcepub fn start_update(&mut self)
pub fn start_update(&mut self)
Start measuring update phase
Sourcepub fn end_update(&mut self)
pub fn end_update(&mut self)
End measuring update phase
Sourcepub fn start_view(&mut self)
pub fn start_view(&mut self)
Start measuring view phase
Sourcepub fn record_event(&mut self)
pub fn record_event(&mut self)
Record an event being processed
Sourcepub fn record_command(&mut self)
pub fn record_command(&mut self)
Record a command being executed
Sourcepub fn record_frame(&mut self, metrics: FrameMetrics)
pub fn record_frame(&mut self, metrics: FrameMetrics)
Record frame metrics
Sourcepub fn average_fps(&self) -> f32
pub fn average_fps(&self) -> f32
Get average FPS over recent frames
Sourcepub fn current_fps(&self) -> f32
pub fn current_fps(&self) -> f32
Get current FPS (based on last frame)
Sourcepub fn average_frame_time(&self) -> Duration
pub fn average_frame_time(&self) -> Duration
Get average frame time
Sourcepub fn summary(&self) -> MetricsSummary
pub fn summary(&self) -> MetricsSummary
Get statistics summary
Trait Implementations§
Source§impl Clone for PerformanceMetrics
impl Clone for PerformanceMetrics
Source§fn clone(&self) -> PerformanceMetrics
fn clone(&self) -> PerformanceMetrics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PerformanceMetrics
impl Debug for PerformanceMetrics
Auto Trait Implementations§
impl Freeze for PerformanceMetrics
impl RefUnwindSafe for PerformanceMetrics
impl Send for PerformanceMetrics
impl Sync for PerformanceMetrics
impl Unpin for PerformanceMetrics
impl UnsafeUnpin for PerformanceMetrics
impl UnwindSafe for PerformanceMetrics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Inspectable for T
impl<T> Inspectable for T
Source§fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
Conditionally inspect this value
Source§fn inspect_with<F>(self, label: &str, f: F) -> Self
fn inspect_with<F>(self, label: &str, f: F) -> Self
Inspect with a custom formatter