pub struct SharedStats { /* private fields */ }Expand description
Thread-safe wrapper for GlobalStats
Implementations§
Sourcepub async fn record_success(
&self,
resolver: SocketAddr,
response_time: Duration,
)
pub async fn record_success( &self, resolver: SocketAddr, response_time: Duration, )
Record a successful query
Sourcepub async fn record_failure(&self, resolver: SocketAddr)
pub async fn record_failure(&self, resolver: SocketAddr)
Record a failed query
Sourcepub async fn record_timeout(&self, resolver: SocketAddr)
pub async fn record_timeout(&self, resolver: SocketAddr)
Record a timed out query
Sourcepub async fn clear_failures(&self, resolver: SocketAddr)
pub async fn clear_failures(&self, resolver: SocketAddr)
Record an answer that can’t be timed, such as the reply to a retry
Sourcepub async fn record_query_sent(&self, resolver: SocketAddr)
pub async fn record_query_sent(&self, resolver: SocketAddr)
Record that a query is about to be sent to a resolver
Sourcepub async fn get_stats(&self) -> GlobalStats
pub async fn get_stats(&self) -> GlobalStats
Get a snapshot of the global stats
Sourcepub async fn record_client_query(&self)
pub async fn record_client_query(&self)
Record a client query
Sourcepub async fn record_cache_hit(&self)
pub async fn record_cache_hit(&self)
Record a cache hit
Sourcepub async fn record_cache_miss(&self)
pub async fn record_cache_miss(&self)
Record a cache miss
Sourcepub async fn get_resolvers_by_speed(&self) -> Vec<(SocketAddr, f64)>
pub async fn get_resolvers_by_speed(&self) -> Vec<(SocketAddr, f64)>
Get a list of resolvers sorted by response time (fastest first)
Sourcepub async fn all_resolvers_failing(&self) -> bool
pub async fn all_resolvers_failing(&self) -> bool
Checks whether every resolver missed enough queries in a row to be considered down
Sourcepub async fn increment_udp_receive_errors(&self)
pub async fn increment_udp_receive_errors(&self)
Increment the UDP receive errors counter
Sourcepub async fn increment_tcp_accept_errors(&self)
pub async fn increment_tcp_accept_errors(&self)
Increment the TCP accept errors counter
Trait Implementations§
Auto Trait Implementations§
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