pub struct Profiler {
pub memory: Arc<RwLock<MemoryProfiler>>,
pub compute: Arc<RwLock<ComputeProfiler>>,
pub timeline: Arc<RwLock<TimelineProfiler>>,
/* private fields */
}Expand description
Unified profiler combining memory, compute, and timeline profiling.
Fields§
§memory: Arc<RwLock<MemoryProfiler>>Memory profiler instance
compute: Arc<RwLock<ComputeProfiler>>Compute profiler instance
timeline: Arc<RwLock<TimelineProfiler>>Timeline profiler instance
Implementations§
Source§impl Profiler
impl Profiler
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enables or disables profiling.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns whether profiling is enabled.
Sourcepub fn record_alloc(&self, name: &str, bytes: usize)
pub fn record_alloc(&self, name: &str, bytes: usize)
Records a memory allocation.
Sourcepub fn record_free(&self, name: &str, bytes: usize)
pub fn record_free(&self, name: &str, bytes: usize)
Records a memory deallocation.
Sourcepub fn peak_memory(&self) -> usize
pub fn peak_memory(&self) -> usize
Gets peak memory usage in bytes.
Sourcepub fn current_memory(&self) -> usize
pub fn current_memory(&self) -> usize
Gets current memory usage in bytes.
Sourcepub fn total_time(&self, name: &str) -> Duration
pub fn total_time(&self, name: &str) -> Duration
Gets the total time spent on an operation.
Sourcepub fn summary(&self) -> ProfileReport
pub fn summary(&self) -> ProfileReport
Generates a summary report.
Sourcepub fn print_summary(&self)
pub fn print_summary(&self)
Prints a summary to stdout.
Sourcepub fn analyze_bottlenecks(&self) -> Vec<Bottleneck>
pub fn analyze_bottlenecks(&self) -> Vec<Bottleneck>
Analyzes for bottlenecks.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Profiler
impl !RefUnwindSafe for Profiler
impl Send for Profiler
impl Sync for Profiler
impl Unpin for Profiler
impl !UnwindSafe for Profiler
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