pub struct Checker { /* private fields */ }Expand description
Repeatedly make connections to a Memcached server to verify connectivity.
Implementations§
Source§impl Checker
impl Checker
Sourcepub fn new(
client: MemcachedClient,
resolver: Discovery,
delay: Duration,
timeout: Duration,
stop: Arc<AtomicBool>,
) -> Self
pub fn new( client: MemcachedClient, resolver: Discovery, delay: Duration, timeout: Duration, stop: Arc<AtomicBool>, ) -> Self
Create a new Checker that uses connections created from the provided client. delay
is the amount of time to wait between each test. timeout is how long each individual
part of the test may take (DNS resolution, connecting, setting a value, and fetching
a value).
Sourcepub async fn run(&self, host: &str, time: Duration) -> Bundle
pub async fn run(&self, host: &str, time: Duration) -> Bundle
Perform connection tests for a particular host in a loop and return information about the time taken for each step of the test (DNS resolution, connecting, setting a value, and fetching a value) and counts of failures or timeouts during each step.
Note that each test run performs a DNS lookup and creates a brand-new connection.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Checker
impl !RefUnwindSafe for Checker
impl Send for Checker
impl Sync for Checker
impl Unpin for Checker
impl !UnwindSafe for Checker
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more