pub struct PoolMetrics {
pub tasks_submitted: AtomicU64,
pub tasks_completed: AtomicU64,
pub tasks_rejected: AtomicU64,
pub queue_depth: AtomicUsize,
pub active_workers: AtomicUsize,
pub total_exec_time_us: AtomicU64,
pub max_exec_time_us: AtomicU64,
}Expand description
Pool metrics for observability
Fields§
§tasks_submitted: AtomicU64Total tasks submitted
tasks_completed: AtomicU64Tasks completed successfully
tasks_rejected: AtomicU64Tasks rejected due to queue full
queue_depth: AtomicUsizeCurrent queue depth
active_workers: AtomicUsizeActive workers
total_exec_time_us: AtomicU64Total execution time (microseconds)
max_exec_time_us: AtomicU64Maximum execution time seen (microseconds)
Implementations§
Source§impl PoolMetrics
impl PoolMetrics
Sourcepub fn record_execution(&self, duration: Duration)
pub fn record_execution(&self, duration: Duration)
Record task execution
Sourcepub fn avg_exec_time_us(&self) -> u64
pub fn avg_exec_time_us(&self) -> u64
Get average execution time
Trait Implementations§
Source§impl Debug for PoolMetrics
impl Debug for PoolMetrics
Source§impl Default for PoolMetrics
impl Default for PoolMetrics
Source§fn default() -> PoolMetrics
fn default() -> PoolMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for PoolMetrics
impl RefUnwindSafe for PoolMetrics
impl Send for PoolMetrics
impl Sync for PoolMetrics
impl Unpin for PoolMetrics
impl UnsafeUnpin for PoolMetrics
impl UnwindSafe for PoolMetrics
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request