Skip to content

Report maxwait for clients that end up not getting a connection #596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ impl ConnectionPool {
// since we last checked the server is ok.
// Health checks are pretty expensive.
if !require_healthcheck {
let checkout_time: u64 = now.elapsed().as_micros() as u64;
let checkout_time = now.elapsed().as_micros() as u64;
client_stats.checkout_time(checkout_time);
server
.stats()
Expand All @@ -734,7 +734,7 @@ impl ConnectionPool {
.run_health_check(address, server, now, client_stats)
.await
{
let checkout_time: u64 = now.elapsed().as_micros() as u64;
let checkout_time = now.elapsed().as_micros() as u64;
client_stats.checkout_time(checkout_time);
server
.stats()
Expand All @@ -746,7 +746,12 @@ impl ConnectionPool {
continue;
}
}

client_stats.idle();

let checkout_time = now.elapsed().as_micros() as u64;
client_stats.checkout_time(checkout_time);

Err(Error::AllServersDown)
}

Expand Down