2
0

Added CheckedOutConnections for ConnPoolStat

Closes #468
This commit is contained in:
MOZGIII
2018-10-23 14:41:21 +03:00
committed by GitHub
parent 20eaa7963b
commit e4632da034
+6
View File
@@ -41,6 +41,12 @@ type ConnPoolStat struct {
AvailableConnections int // unused live connections
}
// CheckedOutConnections returns the amount of connections that are currently
// checked out from the pool.
func (stat *ConnPoolStat) CheckedOutConnections() int {
return stat.CurrentConnections - stat.AvailableConnections
}
// ErrAcquireTimeout occurs when an attempt to acquire a connection times out.
var ErrAcquireTimeout = errors.New("timeout acquiring connection from pool")