pub struct TaskMemoryTracker { /* private fields */ }
Expand description
Central task memory tracker
Aggregates allocation events from thread-local buffers and maintains per-task memory profiles for analysis and reporting.
Implementations§
Source§impl TaskMemoryTracker
impl TaskMemoryTracker
Sourcepub fn start(&mut self) -> AsyncResult<()>
pub fn start(&mut self) -> AsyncResult<()>
Start background aggregation thread
Sourcepub fn stop(&mut self) -> AsyncResult<()>
pub fn stop(&mut self) -> AsyncResult<()>
Stop background aggregation thread
Sourcepub fn process_events(&mut self, events: Vec<AllocationEvent>)
pub fn process_events(&mut self, events: Vec<AllocationEvent>)
Process allocation events and update profiles
Sourcepub fn get_task_profile(&self, task_id: TaskId) -> Option<&TaskMemoryProfile>
pub fn get_task_profile(&self, task_id: TaskId) -> Option<&TaskMemoryProfile>
Get task profile by ID
Sourcepub fn get_all_profiles(&self) -> &HashMap<TaskId, TaskMemoryProfile>
pub fn get_all_profiles(&self) -> &HashMap<TaskId, TaskMemoryProfile>
Get all task profiles
Sourcepub fn get_aggregated_stats(&self) -> &AggregatedTaskStats
pub fn get_aggregated_stats(&self) -> &AggregatedTaskStats
Get aggregated statistics
Sourcepub fn mark_task_completed(&mut self, task_id: TaskId)
pub fn mark_task_completed(&mut self, task_id: TaskId)
Mark task as completed
Sourcepub fn cleanup_completed_tasks(&mut self, max_completed: usize)
pub fn cleanup_completed_tasks(&mut self, max_completed: usize)
Clean up completed tasks (keep only recent ones)
Trait Implementations§
Source§impl Default for TaskMemoryTracker
impl Default for TaskMemoryTracker
Auto Trait Implementations§
impl Freeze for TaskMemoryTracker
impl !RefUnwindSafe for TaskMemoryTracker
impl Send for TaskMemoryTracker
impl Sync for TaskMemoryTracker
impl Unpin for TaskMemoryTracker
impl !UnwindSafe for TaskMemoryTracker
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more