pub struct MetricsCollector {
pub requests: RequestMetrics,
pub connections: ConnectionMetrics,
pub performance: PerformanceMetrics,
pub errors: ErrorMetrics,
pub resources: ResourceMetrics,
}Expand description
Global metrics collection system
Fields§
§requests: RequestMetricsRequest counters
connections: ConnectionMetricsConnection metrics
performance: PerformanceMetricsPerformance metrics
errors: ErrorMetricsError tracking
resources: ResourceMetricsResource usage
Implementations§
Source§impl MetricsCollector
impl MetricsCollector
pub fn new() -> Self
Sourcepub fn request_start(&self, method: &str) -> RequestTracker<'_>
pub fn request_start(&self, method: &str) -> RequestTracker<'_>
Record a request start
Sourcepub fn connection_created(&self, from_pool: bool)
pub fn connection_created(&self, from_pool: bool)
Record a connection event
Sourcepub fn connection_failed(&self)
pub fn connection_failed(&self)
Record connection failure
Sourcepub fn record_error(&self, error_type: &str)
pub fn record_error(&self, error_type: &str)
Record an error
Sourcepub fn record_retry(&self, attempt: usize, success: bool)
pub fn record_retry(&self, attempt: usize, success: bool)
Record retry attempt
Sourcepub fn update_buffer_pool_stats(&self, stats: BufferPoolStats)
pub fn update_buffer_pool_stats(&self, stats: BufferPoolStats)
Update resource usage
pub fn update_parser_cache_stats(&self, stats: ParserCacheStats)
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Get comprehensive metrics snapshot
Sourcepub fn print_summary(&self)
pub fn print_summary(&self)
Print metrics summary
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MetricsCollector
impl !RefUnwindSafe for MetricsCollector
impl Send for MetricsCollector
impl Sync for MetricsCollector
impl Unpin for MetricsCollector
impl UnsafeUnpin for MetricsCollector
impl UnwindSafe for MetricsCollector
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