shad-go/lectures/07-sql/conf/stats.go

20 lines
979 B
Go
Raw Normal View History

2021-04-08 11:32:08 +00:00
package conf
2022-02-10 22:06:57 +00:00
import "time"
2021-04-08 11:32:08 +00:00
type DBStats struct {
2021-04-08 11:37:21 +00:00
MaxOpenConnections int // Maximum number of open connections to the database; added in Go 1.11
2021-04-08 11:32:08 +00:00
2021-04-08 11:37:21 +00:00
// Pool Status
OpenConnections int // The number of established connections both in use and idle.
InUse int // The number of connections currently in use; added in Go 1.11
Idle int // The number of idle connections; added in Go 1.11
2021-04-08 11:32:08 +00:00
2021-04-08 11:37:21 +00:00
// Counters
WaitCount int64 // The total number of connections waited for; added in Go 1.11
WaitDuration time.Duration // The total time blocked waiting for a new connection; added in Go 1.11
MaxIdleClosed int64 // The total number of connections closed due to SetMaxIdleConns; added in Go 1.11
MaxIdleTimeClosed int64 // The total number of connections closed due to SetConnMaxIdleTime; added in Go 1.15
MaxLifetimeClosed int64 // The total number of connections closed due to SetConnMaxLifetime; added in Go 1.11
2021-04-08 11:32:08 +00:00
}