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

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()),
	)
}