pub struct ProductionMetricsCollector { /* private fields */ }Expand description
Production metrics collector with intelligent sampling
Implementations§
Source§impl ProductionMetricsCollector
impl ProductionMetricsCollector
Sourcepub async fn new(config: MetricsConfig) -> Result<Self, MonitoringError>
pub async fn new(config: MetricsConfig) -> Result<Self, MonitoringError>
Create new production metrics collector
Sourcepub async fn start(&self) -> Result<(), MonitoringError>
pub async fn start(&self) -> Result<(), MonitoringError>
Start metrics collection
Sourcepub async fn stop(&self) -> Result<(), MonitoringError>
pub async fn stop(&self) -> Result<(), MonitoringError>
Stop metrics collection
Sourcepub async fn record_nat_attempt(
&self,
attempt: &NatTraversalAttempt,
) -> Result<(), MonitoringError>
pub async fn record_nat_attempt( &self, attempt: &NatTraversalAttempt, ) -> Result<(), MonitoringError>
Record NAT traversal attempt
Sourcepub async fn record_nat_result(
&self,
result: &NatTraversalResult,
) -> Result<(), MonitoringError>
pub async fn record_nat_result( &self, result: &NatTraversalResult, ) -> Result<(), MonitoringError>
Record NAT traversal result
Sourcepub async fn get_status(&self) -> String
pub async fn get_status(&self) -> String
Get collector status
Sourcepub async fn get_summary(&self) -> MetricsSummary
pub async fn get_summary(&self) -> MetricsSummary
Get metrics summary
Source§impl ProductionMetricsCollector
Comprehensive metrics collection implementation
impl ProductionMetricsCollector
Comprehensive metrics collection implementation
Sourcepub async fn record_bootstrap_performance(
&self,
node_address: SocketAddr,
response_time: Duration,
success: bool,
) -> Result<(), MonitoringError>
pub async fn record_bootstrap_performance( &self, node_address: SocketAddr, response_time: Duration, success: bool, ) -> Result<(), MonitoringError>
Record bootstrap node performance
Sourcepub async fn record_nat_type_result(
&self,
nat_type: NatType,
success: bool,
duration: Duration,
error_category: Option<ErrorCategory>,
) -> Result<(), MonitoringError>
pub async fn record_nat_type_result( &self, nat_type: NatType, success: bool, duration: Duration, error_category: Option<ErrorCategory>, ) -> Result<(), MonitoringError>
Record NAT type specific metrics
Sourcepub async fn record_connection_quality(
&self,
latency_ms: u32,
jitter_ms: u32,
throughput_mbps: f32,
packet_loss_rate: f32,
) -> Result<(), MonitoringError>
pub async fn record_connection_quality( &self, latency_ms: u32, jitter_ms: u32, throughput_mbps: f32, packet_loss_rate: f32, ) -> Result<(), MonitoringError>
Record connection quality metrics
Sourcepub async fn get_bootstrap_metrics(&self) -> Vec<BootstrapNodeMetrics>
pub async fn get_bootstrap_metrics(&self) -> Vec<BootstrapNodeMetrics>
Get bootstrap node metrics
Sourcepub async fn get_nat_type_metrics(&self) -> Vec<NatTypeMetrics>
pub async fn get_nat_type_metrics(&self) -> Vec<NatTypeMetrics>
Get NAT type success rate metrics
Sourcepub async fn get_latency_metrics(&self) -> LatencyMetrics
pub async fn get_latency_metrics(&self) -> LatencyMetrics
Get latency and RTT metrics
Auto Trait Implementations§
impl Freeze for ProductionMetricsCollector
impl !RefUnwindSafe for ProductionMetricsCollector
impl Send for ProductionMetricsCollector
impl Sync for ProductionMetricsCollector
impl Unpin for ProductionMetricsCollector
impl !UnwindSafe for ProductionMetricsCollector
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