15 lines
334 B
Go
15 lines
334 B
Go
package database
|
|
|
|
import (
|
|
"github.com/jackc/pgx/v4/pgxpool"
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
func LogPoolState(pool *pgxpool.Pool, message string) {
|
|
stat := pool.Stat()
|
|
log.Info().
|
|
Int32("acquired_conns", stat.AcquiredConns()).
|
|
Int32("idle_conns", stat.IdleConns()).
|
|
Int32("total_conns", stat.TotalConns()).
|
|
Msg(message)
|
|
}
|