Merge pull request #2208 from vamshiaruru/feat/expose_empty_acquire_wait_time_from_puddle

Expose puddle.Pool's EmptyAcquireWaitTime in pgxpool's Stats
This commit is contained in:
Jack Christensen 2024-12-30 20:03:51 -06:00 committed by GitHub
commit 00b86ca3db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,3 +82,10 @@ func (s *Stat) MaxLifetimeDestroyCount() int64 {
func (s *Stat) MaxIdleDestroyCount() int64 { func (s *Stat) MaxIdleDestroyCount() int64 {
return s.idleDestroyCount 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()
}