pub struct FailureTracker { /* private fields */ }Expand description
Per-domain, per-browser failure tracker with 10-minute TTL.
All methods are &self (no &mut self), making this safe to share
across tasks via Arc<FailureTracker>.
Implementations§
Source§impl FailureTracker
impl FailureTracker
Sourcepub fn record_failure(&self, domain: &str, browser: &str)
pub fn record_failure(&self, domain: &str, browser: &str)
Record a failure for a domain + browser pair (defaults to the
“transient” class). See record_failure_class.
Sourcepub fn record_failure_class(
&self,
domain: &str,
browser: &str,
error_class: &str,
)
pub fn record_failure_class( &self, domain: &str, browser: &str, error_class: &str, )
Record a failure tagged with its class (“blocked”, “transient”, …) for selective clearing on stealth escalation.
Sourcepub fn record_success(&self, domain: &str, browser: &str)
pub fn record_success(&self, domain: &str, browser: &str)
Record a success – clears the failure counter for a domain + browser.
Sourcepub fn failure_count(&self, domain: &str, browser: &str) -> u32
pub fn failure_count(&self, domain: &str, browser: &str) -> u32
Get failure count (0 if expired or not found).
Sourcepub fn total_failure_count(&self, domain: &str) -> u32
pub fn total_failure_count(&self, domain: &str) -> u32
Get total failures across all browsers for a domain (unexpired only).
Sourcepub fn clear(&self, domain: &str)
pub fn clear(&self, domain: &str)
Clear all failure records for a domain (regardless of class).
Sourcepub fn clear_class(&self, domain: &str, error_class: &str)
pub fn clear_class(&self, domain: &str, error_class: &str)
Clear only failures of a given class for a domain.
Used on stealth escalation: blocked failures are cleared (a higher
stealth tier can bypass the block), while transient/disconnect failures
are retained (escalating stealth won’t fix flaky infra, so we keep
skipping a browser that keeps dropping on this domain).