Profiler

Struct Profiler 

Source
pub struct Profiler { /* private fields */ }
Expand description

Performance profiler

Implementations§

Source§

impl Profiler

Source

pub fn new() -> Self

Create a new profiler

Source

pub fn set_bottleneck_threshold(&mut self, threshold_ms: u64)

Set bottleneck detection threshold

Source

pub fn set_contention_threshold(&mut self, threshold: f64)

Set contention threshold

Source

pub fn record_lock_wait( &mut self, resource_id: ResourceId, name: String, wait_time: Duration, task_id: TaskId, )

Record lock wait event

Source

pub fn record_lock_acquisition(&mut self, resource_id: ResourceId, name: String)

Record lock acquisition

Source

pub fn record_lock_attempt(&mut self, resource_id: ResourceId, name: String)

Record lock acquire attempt

Source

pub fn get_lock_metrics( &self, resource_id: &ResourceId, ) -> Option<&LockContentionMetrics>

Get lock contention metrics

Source

pub fn all_lock_metrics(&self) -> Vec<&LockContentionMetrics>

Get all lock contention metrics

Source

pub fn most_contended_locks(&self, count: usize) -> Vec<&LockContentionMetrics>

Get most contended locks

Source

pub fn identify_highly_contended_locks(&self) -> Vec<&LockContentionMetrics>

Identify highly contended locks

Source

pub fn record_task(&mut self, metrics: TaskMetrics)

Record task metrics

Source

pub fn get_task_metrics(&self, task_id: &TaskId) -> Option<&TaskMetrics>

Get metrics for a specific task

Source

pub fn all_metrics(&self) -> Vec<&TaskMetrics>

Get all task metrics

Source

pub fn identify_bottlenecks(&self) -> Vec<&TaskMetrics>

Identify bottleneck tasks

Source

pub fn get_hot_paths(&self) -> Vec<&HotPath>

Get hot paths sorted by execution count

Source

pub fn calculate_stats(&self) -> DurationStats

Calculate overall statistics

Source

pub fn await_stats(&self) -> DurationStats

Calculate await point statistics

Source

pub fn slowest_tasks(&self, count: usize) -> Vec<&TaskMetrics>

Find slowest tasks

Source

pub fn busiest_tasks(&self, count: usize) -> Vec<&TaskMetrics>

Find tasks with most polls (busy tasks)

Source

pub fn least_efficient_tasks(&self, count: usize) -> Vec<&TaskMetrics>

Find least efficient tasks (high blocked time ratio)

Source

pub fn create_snapshot(&self, run_id: String) -> PerformanceSnapshot

Create a performance snapshot

Trait Implementations§

Source§

impl Default for Profiler

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,