Skip to content

Commit

Permalink
Merge pull request #2208 from vamshiaruru/feat/expose_empty_acquire_w…
Browse files Browse the repository at this point in the history
…ait_time_from_puddle

Expose puddle.Pool's EmptyAcquireWaitTime in pgxpool's Stats
  • Loading branch information
jackc authored Dec 31, 2024
2 parents bcf3fbd + 12b37f3 commit 00b86ca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pgxpool/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,10 @@ func (s *Stat) MaxLifetimeDestroyCount() int64 {
func (s *Stat) MaxIdleDestroyCount() int64 {
return s.idleDestroyCount
}

// EmptyAcquireWaitTime returns the cumulative time waited for successful acquires
// from the pool for a resource to be released or constructed because the pool was
// empty.
func (s *Stat) EmptyAcquireWaitTime() time.Duration {
return s.s.EmptyAcquireWaitTime()
}

0 comments on commit 00b86ca

Please sign in to comment.