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

This commit is contained in:
Lev Kokotov
2023-09-21 14:50:18 -07:00
committed by GitHub
parent df8aa888f9
commit b2933762e7

View File

@@ -720,7 +720,7 @@ impl ConnectionPool {
// since we last checked the server is ok. // since we last checked the server is ok.
// Health checks are pretty expensive. // Health checks are pretty expensive.
if !require_healthcheck { 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); client_stats.checkout_time(checkout_time);
server server
.stats() .stats()
@@ -734,7 +734,7 @@ impl ConnectionPool {
.run_health_check(address, server, now, client_stats) .run_health_check(address, server, now, client_stats)
.await .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); client_stats.checkout_time(checkout_time);
server server
.stats() .stats()
@@ -746,7 +746,12 @@ impl ConnectionPool {
continue; continue;
} }
} }
client_stats.idle(); client_stats.idle();
let checkout_time = now.elapsed().as_micros() as u64;
client_stats.checkout_time(checkout_time);
Err(Error::AllServersDown) Err(Error::AllServersDown)
} }