pub struct PerformanceProfiler { /* private fields */ }Expand description
Performance profiler for capturing metrics
Implementations§
Source§impl PerformanceProfiler
impl PerformanceProfiler
Sourcepub fn stop(&mut self) -> PerformanceProfile
pub fn stop(&mut self) -> PerformanceProfile
Stop profiling
Sourcepub fn elapsed_ms(&self) -> u64
pub fn elapsed_ms(&self) -> u64
Get elapsed time in milliseconds
Sourcepub fn record(&mut self, measurement: Measurement)
pub fn record(&mut self, measurement: Measurement)
Record a measurement
Sourcepub fn record_frame_time(&mut self, ms: f64)
pub fn record_frame_time(&mut self, ms: f64)
Record a frame time
Sourcepub fn record_timing(&mut self, name: &str, ms: f64)
pub fn record_timing(&mut self, name: &str, ms: f64)
Record a custom timing
Sourcepub fn record_memory(&mut self, name: &str, bytes: u64)
pub fn record_memory(&mut self, name: &str, bytes: u64)
Record memory usage
Sourcepub fn start_timer(&mut self, name: &str)
pub fn start_timer(&mut self, name: &str)
Start a timer
Sourcepub fn stop_timer(&mut self, name: &str) -> Option<f64>
pub fn stop_timer(&mut self, name: &str) -> Option<f64>
Stop a timer and record the measurement
Sourcepub fn add_threshold(&mut self, threshold: PerformanceThreshold)
pub fn add_threshold(&mut self, threshold: PerformanceThreshold)
Add a threshold
Sourcepub fn check_thresholds(&self) -> ProbarResult<()>
pub fn check_thresholds(&self) -> ProbarResult<()>
Check all thresholds
Sourcepub fn profile(&self) -> &PerformanceProfile
pub fn profile(&self) -> &PerformanceProfile
Get current profile
Sourcepub fn stats(&self, name: &str) -> Option<MetricStats>
pub fn stats(&self, name: &str) -> Option<MetricStats>
Get statistics for a metric
Trait Implementations§
Source§impl Debug for PerformanceProfiler
impl Debug for PerformanceProfiler
Auto Trait Implementations§
impl Freeze for PerformanceProfiler
impl RefUnwindSafe for PerformanceProfiler
impl Send for PerformanceProfiler
impl Sync for PerformanceProfiler
impl Unpin for PerformanceProfiler
impl UnsafeUnpin for PerformanceProfiler
impl UnwindSafe for PerformanceProfiler
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