Skip to content

Commit b293376

Browse files
authored
Report maxwait for clients that end up not getting a connection (#596)
1 parent df8aa88 commit b293376

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/pool.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ impl ConnectionPool {
720720
// since we last checked the server is ok.
721721
// Health checks are pretty expensive.
722722
if !require_healthcheck {
723-
let checkout_time: u64 = now.elapsed().as_micros() as u64;
723+
let checkout_time = now.elapsed().as_micros() as u64;
724724
client_stats.checkout_time(checkout_time);
725725
server
726726
.stats()
@@ -734,7 +734,7 @@ impl ConnectionPool {
734734
.run_health_check(address, server, now, client_stats)
735735
.await
736736
{
737-
let checkout_time: u64 = now.elapsed().as_micros() as u64;
737+
let checkout_time = now.elapsed().as_micros() as u64;
738738
client_stats.checkout_time(checkout_time);
739739
server
740740
.stats()
@@ -746,7 +746,12 @@ impl ConnectionPool {
746746
continue;
747747
}
748748
}
749+
749750
client_stats.idle();
751+
752+
let checkout_time = now.elapsed().as_micros() as u64;
753+
client_stats.checkout_time(checkout_time);
754+
750755
Err(Error::AllServersDown)
751756
}
752757

0 commit comments

Comments
 (0)