pub struct AsyncMetrics {
pub total_operations: AtomicU64,
pub completed_operations: AtomicU64,
pub cancelled_operations: AtomicU64,
pub timeout_operations: AtomicU64,
pub peak_memory_usage: AtomicU64,
pub active_operations: AtomicU64,
pub total_bytes_read: AtomicU64,
}Available on crate feature
async only.Expand description
Metrics for async operations
Fields§
§total_operations: AtomicU64Total number of operations started
completed_operations: AtomicU64Number of completed operations
cancelled_operations: AtomicU64Number of cancelled operations
timeout_operations: AtomicU64Number of timeout operations
peak_memory_usage: AtomicU64Peak memory usage during async operations
active_operations: AtomicU64Current active operations
total_bytes_read: AtomicU64Total bytes read asynchronously
Implementations§
Source§impl AsyncMetrics
impl AsyncMetrics
Sourcepub fn record_operation_start(&self)
pub fn record_operation_start(&self)
Record the start of an operation
Sourcepub fn record_operation_complete(&self, bytes_read: u64)
pub fn record_operation_complete(&self, bytes_read: u64)
Record operation completion
Sourcepub fn record_operation_cancelled(&self)
pub fn record_operation_cancelled(&self)
Record operation cancellation
Sourcepub fn record_operation_timeout(&self)
pub fn record_operation_timeout(&self)
Record operation timeout
Sourcepub fn update_peak_memory(&self, current_usage: u64)
pub fn update_peak_memory(&self, current_usage: u64)
Update peak memory usage
Sourcepub fn get_stats(&self) -> AsyncOperationStats
pub fn get_stats(&self) -> AsyncOperationStats
Get current statistics
Trait Implementations§
Source§impl Debug for AsyncMetrics
impl Debug for AsyncMetrics
Source§impl Default for AsyncMetrics
impl Default for AsyncMetrics
Source§fn default() -> AsyncMetrics
fn default() -> AsyncMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for AsyncMetrics
impl RefUnwindSafe for AsyncMetrics
impl Send for AsyncMetrics
impl Sync for AsyncMetrics
impl Unpin for AsyncMetrics
impl UnwindSafe for AsyncMetrics
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> 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