dev.go 394 Bytes
Newer Older
Vladimir Barsukov's avatar
zgo  
Vladimir Barsukov committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//go:build dev

package zdb

import "log"

func logConnStat(conn *Conn) {
	log.Printf("\033[9%dm%s\u001B[0m -> idle: %d; acquired: %d, total: %d, max: %d, ratio: %0.2f",
		conn.Index+1,
		conn.ToString(),
		conn.Stat().IdleConns(),
		conn.Stat().AcquiredConns(),
		conn.Stat().TotalConns(),
		conn.Stat().MaxConns(),
		float64(conn.Stat().AcquiredConns())/float64(conn.Stat().MaxConns()),
	)
}