pub struct Profiler { /* private fields */ }Expand description
Performance profiler
Implementations§
Source§impl Profiler
impl Profiler
Sourcepub fn set_bottleneck_threshold(&mut self, threshold_ms: u64)
pub fn set_bottleneck_threshold(&mut self, threshold_ms: u64)
Set bottleneck detection threshold
Sourcepub fn set_contention_threshold(&mut self, threshold: f64)
pub fn set_contention_threshold(&mut self, threshold: f64)
Set contention threshold
Sourcepub fn record_lock_wait(
&mut self,
resource_id: ResourceId,
name: String,
wait_time: Duration,
task_id: TaskId,
)
pub fn record_lock_wait( &mut self, resource_id: ResourceId, name: String, wait_time: Duration, task_id: TaskId, )
Record lock wait event
Sourcepub fn record_lock_acquisition(&mut self, resource_id: ResourceId, name: String)
pub fn record_lock_acquisition(&mut self, resource_id: ResourceId, name: String)
Record lock acquisition
Sourcepub fn record_lock_attempt(&mut self, resource_id: ResourceId, name: String)
pub fn record_lock_attempt(&mut self, resource_id: ResourceId, name: String)
Record lock acquire attempt
Sourcepub fn get_lock_metrics(
&self,
resource_id: &ResourceId,
) -> Option<&LockContentionMetrics>
pub fn get_lock_metrics( &self, resource_id: &ResourceId, ) -> Option<&LockContentionMetrics>
Get lock contention metrics
Sourcepub fn all_lock_metrics(&self) -> Vec<&LockContentionMetrics>
pub fn all_lock_metrics(&self) -> Vec<&LockContentionMetrics>
Get all lock contention metrics
Sourcepub fn most_contended_locks(&self, count: usize) -> Vec<&LockContentionMetrics>
pub fn most_contended_locks(&self, count: usize) -> Vec<&LockContentionMetrics>
Get most contended locks
Sourcepub fn identify_highly_contended_locks(&self) -> Vec<&LockContentionMetrics>
pub fn identify_highly_contended_locks(&self) -> Vec<&LockContentionMetrics>
Identify highly contended locks
Sourcepub fn record_task(&mut self, metrics: TaskMetrics)
pub fn record_task(&mut self, metrics: TaskMetrics)
Record task metrics
Sourcepub fn get_task_metrics(&self, task_id: &TaskId) -> Option<&TaskMetrics>
pub fn get_task_metrics(&self, task_id: &TaskId) -> Option<&TaskMetrics>
Get metrics for a specific task
Sourcepub fn all_metrics(&self) -> Vec<&TaskMetrics>
pub fn all_metrics(&self) -> Vec<&TaskMetrics>
Get all task metrics
Sourcepub fn identify_bottlenecks(&self) -> Vec<&TaskMetrics>
pub fn identify_bottlenecks(&self) -> Vec<&TaskMetrics>
Identify bottleneck tasks
Sourcepub fn get_hot_paths(&self) -> Vec<&HotPath>
pub fn get_hot_paths(&self) -> Vec<&HotPath>
Get hot paths sorted by execution count
Sourcepub fn calculate_stats(&self) -> DurationStats
pub fn calculate_stats(&self) -> DurationStats
Calculate overall statistics
Sourcepub fn await_stats(&self) -> DurationStats
pub fn await_stats(&self) -> DurationStats
Calculate await point statistics
Sourcepub fn slowest_tasks(&self, count: usize) -> Vec<&TaskMetrics>
pub fn slowest_tasks(&self, count: usize) -> Vec<&TaskMetrics>
Find slowest tasks
Sourcepub fn busiest_tasks(&self, count: usize) -> Vec<&TaskMetrics>
pub fn busiest_tasks(&self, count: usize) -> Vec<&TaskMetrics>
Find tasks with most polls (busy tasks)
Sourcepub fn least_efficient_tasks(&self, count: usize) -> Vec<&TaskMetrics>
pub fn least_efficient_tasks(&self, count: usize) -> Vec<&TaskMetrics>
Find least efficient tasks (high blocked time ratio)
Sourcepub fn create_snapshot(&self, run_id: String) -> PerformanceSnapshot
pub fn create_snapshot(&self, run_id: String) -> PerformanceSnapshot
Create a performance snapshot
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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