From 0c145a3faa750451c59a1d537fa2b0743d58d4fa Mon Sep 17 00:00:00 2001 From: drpytho Date: Tue, 6 Oct 2020 15:55:40 +0200 Subject: [PATCH] Add/Copy docstring from puddle --- pgxpool/stat.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pgxpool/stat.go b/pgxpool/stat.go index 1afda8ef..a4b2e750 100644 --- a/pgxpool/stat.go +++ b/pgxpool/stat.go @@ -10,38 +10,54 @@ type Stat struct { s *puddle.Stat } +// AcquireCount returns the cumulative count of successful acquires from the pool. func (s *Stat) AcquireCount() int64 { return s.s.AcquireCount() } +// AcquireDuration returns the total duration of all successful acquires from +// the pool. func (s *Stat) AcquireDuration() time.Duration { return s.s.AcquireDuration() } +// AcquiredConns returns the number of currently acquired connections in the pool. func (s *Stat) AcquiredConns() int32 { return s.s.AcquiredResources() } +// CanceledAcquireCount returns the cumulative count of acquires from the pool +// that were canceled by a context. func (s *Stat) CanceledAcquireCount() int64 { return s.s.CanceledAcquireCount() } +// ConstructingConns returns the number of conns with construction in progress in +// the pool. func (s *Stat) ConstructingConns() int32 { return s.s.ConstructingResources() } +// EmptyAcquireCount returns the cumulative count of successful acquires from the pool +// that waited for a resource to be released or constructed because the pool was +// empty. func (s *Stat) EmptyAcquireCount() int64 { return s.s.EmptyAcquireCount() } +// IdleConns returns the number of currently idle conns in the pool. func (s *Stat) IdleConns() int32 { return s.s.IdleResources() } +// MaxResources returns the maximum size of the pool. func (s *Stat) MaxConns() int32 { return s.s.MaxResources() } +// TotalConns returns the total number of resources currently in the pool. +// The value is the sum of ConstructingConns, AcquiredConns, and +// IdleConns. func (s *Stat) TotalConns() int32 { return s.s.TotalResources() }