pub struct AsyncResourceMonitor { /* private fields */ }
Expand description
Resource monitor for tracking async task performance
Implementations§
Source§impl AsyncResourceMonitor
impl AsyncResourceMonitor
pub fn new() -> Self
Sourcepub fn start_monitoring(
&mut self,
task_id: TaskId,
task_name: String,
task_type: TaskType,
)
pub fn start_monitoring( &mut self, task_id: TaskId, task_name: String, task_type: TaskType, )
Start monitoring a new task
Sourcepub fn start_monitoring_with_location(
&mut self,
task_id: TaskId,
task_name: String,
task_type: TaskType,
source_location: Option<SourceLocation>,
)
pub fn start_monitoring_with_location( &mut self, task_id: TaskId, task_name: String, task_type: TaskType, source_location: Option<SourceLocation>, )
Start monitoring a new task with source location
Sourcepub fn update_metrics(&mut self, task_id: TaskId)
pub fn update_metrics(&mut self, task_id: TaskId)
Update metrics for a running task
Sourcepub fn finish_monitoring(&mut self, task_id: TaskId)
pub fn finish_monitoring(&mut self, task_id: TaskId)
Finish monitoring a task
Sourcepub fn get_all_profiles(&self) -> &HashMap<TaskId, TaskResourceProfile>
pub fn get_all_profiles(&self) -> &HashMap<TaskId, TaskResourceProfile>
Get all task profiles
Sourcepub fn get_profile(&self, task_id: TaskId) -> Option<&TaskResourceProfile>
pub fn get_profile(&self, task_id: TaskId) -> Option<&TaskResourceProfile>
Get profile for specific task
Sourcepub fn get_monitoring_overhead_ns(&self) -> u64
pub fn get_monitoring_overhead_ns(&self) -> u64
Get monitoring overhead in nanoseconds
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AsyncResourceMonitor
impl RefUnwindSafe for AsyncResourceMonitor
impl Send for AsyncResourceMonitor
impl Sync for AsyncResourceMonitor
impl Unpin for AsyncResourceMonitor
impl UnwindSafe for AsyncResourceMonitor
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