pub struct SendErrorTracker { /* private fields */ }Expand description
Production-grade send error tracker with per-channel state.
Thread-safe — uses DashMap for per-channel state and atomics for global counters.
Implementations§
Source§impl SendErrorTracker
impl SendErrorTracker
Sourcepub fn new(config: SendErrorTrackerConfig) -> Self
pub fn new(config: SendErrorTrackerConfig) -> Self
Create a new tracker with the given configuration.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a tracker with default configuration.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if the tracker is enabled.
Sourcepub fn config(&self) -> &SendErrorTrackerConfig
pub fn config(&self) -> &SendErrorTrackerConfig
Get the configuration.
Sourcepub fn on_send_success(&self, channel_id: u8)
pub fn on_send_success(&self, channel_id: u8)
Record a successful send for a channel.
Sourcepub fn on_send_failure(
&self,
channel_id: u8,
category: ErrorCategory,
) -> TrackingResult
pub fn on_send_failure( &self, channel_id: u8, category: ErrorCategory, ) -> TrackingResult
Record a send failure for a channel.
Returns a TrackingResult indicating whether any threshold was exceeded.
Sourcepub fn on_ack_error(&self, channel_id: u8, _status: u8) -> TrackingResult
pub fn on_ack_error(&self, channel_id: u8, _status: u8) -> TrackingResult
Record an ACK error.
Sourcepub fn on_ack_timeout(&self, channel_id: u8) -> TrackingResult
pub fn on_ack_timeout(&self, channel_id: u8) -> TrackingResult
Record an ACK timeout.
Sourcepub fn on_confirmation_nack(&self, channel_id: u8) -> TrackingResult
pub fn on_confirmation_nack(&self, channel_id: u8) -> TrackingResult
Record a confirmation NACK.
Sourcepub fn on_confirmation_timeout(&self, channel_id: u8) -> TrackingResult
pub fn on_confirmation_timeout(&self, channel_id: u8) -> TrackingResult
Record a confirmation timeout.
Sourcepub fn on_flow_control_drop(&self, channel_id: u8) -> TrackingResult
pub fn on_flow_control_drop(&self, channel_id: u8) -> TrackingResult
Record a flow control drop.
Sourcepub fn consecutive_errors(&self, channel_id: u8) -> u32
pub fn consecutive_errors(&self, channel_id: u8) -> u32
Get the consecutive error count for a channel.
Sourcepub fn window_error_count(&self, channel_id: u8) -> usize
pub fn window_error_count(&self, channel_id: u8) -> usize
Get the error count in the current sliding window for a channel.
Sourcepub fn is_restart_triggered(&self, channel_id: u8) -> bool
pub fn is_restart_triggered(&self, channel_id: u8) -> bool
Check if a channel has triggered a restart.
Sourcepub fn reset_channel(&self, channel_id: u8)
pub fn reset_channel(&self, channel_id: u8)
Reset error state for a channel.
Sourcepub fn remove_channel(&self, channel_id: u8)
pub fn remove_channel(&self, channel_id: u8)
Remove a channel’s tracking state entirely.
Sourcepub fn channel_summary(&self, channel_id: u8) -> Option<ChannelErrorSummary>
pub fn channel_summary(&self, channel_id: u8) -> Option<ChannelErrorSummary>
Get a summary for a specific channel.
Sourcepub fn stats_snapshot(&self) -> TrackerStatsSnapshot
pub fn stats_snapshot(&self) -> TrackerStatsSnapshot
Get global statistics.