pub struct MemoryProfiler { /* private fields */ }Expand description
Memory profiler for tracking allocations and usage patterns.
Implementations§
Source§impl MemoryProfiler
impl MemoryProfiler
Sourcepub fn new(config: MemoryProfilerConfig) -> Self
pub fn new(config: MemoryProfilerConfig) -> Self
Create a new memory profiler.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if profiling is active.
Sourcepub fn record_allocation(&self, label: &str, size: usize)
pub fn record_allocation(&self, label: &str, size: usize)
Record a memory allocation.
Sourcepub fn record_deallocation(&self, label: &str, size: usize)
pub fn record_deallocation(&self, label: &str, size: usize)
Record a memory deallocation.
Sourcepub fn snapshot(&self) -> MemorySnapshot
pub fn snapshot(&self) -> MemorySnapshot
Get current memory snapshot.
Sourcepub fn history(&self) -> Vec<TimestampedSnapshot>
pub fn history(&self) -> Vec<TimestampedSnapshot>
Get historical snapshots.
Sourcepub fn generate_report(&self) -> MemoryReport
pub fn generate_report(&self) -> MemoryReport
Generate a memory report.
Sourcepub fn region_usage(&self, label: &str) -> Option<RegionSnapshot>
pub fn region_usage(&self, label: &str) -> Option<RegionSnapshot>
Get memory usage for a specific region.
Auto Trait Implementations§
impl !Freeze for MemoryProfiler
impl !RefUnwindSafe for MemoryProfiler
impl Send for MemoryProfiler
impl Sync for MemoryProfiler
impl Unpin for MemoryProfiler
impl UnsafeUnpin for MemoryProfiler
impl UnwindSafe for MemoryProfiler
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