pub struct Metrics { /* private fields */ }Expand description
Core metrics collector for IPFRS operations
This struct uses atomic operations for lock-free performance in hot paths, while protecting detailed statistics with mutexes.
Implementations§
Source§impl Metrics
impl Metrics
Sourcepub fn record_block_created(&self, size_bytes: u64)
pub fn record_block_created(&self, size_bytes: u64)
Record a block creation
Sourcepub fn record_block_created_timed(&self, size_bytes: u64, duration_us: u64)
pub fn record_block_created_timed(&self, size_bytes: u64, duration_us: u64)
Record block creation with timing
Sourcepub fn record_cid_generated(&self, duration_us: u64)
pub fn record_cid_generated(&self, duration_us: u64)
Record a CID generation
Sourcepub fn record_block_verified(&self, duration_us: u64)
pub fn record_block_verified(&self, duration_us: u64)
Record a block verification
Sourcepub fn record_chunking(&self, num_chunks: usize, duration_us: u64)
pub fn record_chunking(&self, num_chunks: usize, duration_us: u64)
Record chunking operation
Sourcepub fn record_serialization_error(&self)
pub fn record_serialization_error(&self)
Record a serialization error
Sourcepub fn record_validation_error(&self)
pub fn record_validation_error(&self)
Record a validation error
Sourcepub fn record_network_error(&self)
pub fn record_network_error(&self)
Record a network error
Sourcepub fn record_memory_allocation(&self, bytes: u64)
pub fn record_memory_allocation(&self, bytes: u64)
Record memory allocation
Sourcepub fn record_pool_hit(&self)
pub fn record_pool_hit(&self)
Record pool hit
Sourcepub fn record_pool_miss(&self)
pub fn record_pool_miss(&self)
Record pool miss
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Get a snapshot of current metrics
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Check if system is healthy
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnwindSafe for Metrics
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