Skip to content

Commit

Permalink
Record WaitingForConnection stat for StreamConn
Browse files Browse the repository at this point in the history
Apply the same logic as `getConn`, i.e., record the stat even in error
paths (for `getStreamConn`).

Signed-off-by: Tyler Coleman <[email protected]>
  • Loading branch information
tycol7 committed Jan 29, 2024
1 parent f5a6741 commit 07bb8bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/vt/vttablet/tabletserver/query_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -795,9 +795,11 @@ func (qre *QueryExecutor) getStreamConn() (*connpool.PooledConn, error) {

start := time.Now()
conn, err := qre.tsv.qe.streamConns.Get(ctx, qre.setting)

qre.logStats.WaitingForConnection += time.Since(start)

switch err {
case nil:
qre.logStats.WaitingForConnection += time.Since(start)
return conn, nil
case connpool.ErrConnPoolClosed:
return nil, err
Expand Down

0 comments on commit 07bb8bb

Please sign in to comment.