mirror of
https://github.com/zr-hebo/sniffer-agent.git
synced 2025-08-11 23:02:12 +08:00
优化性能
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
du "github.com/zr-hebo/util-db"
|
||||
// log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func expandLocalMysql(port int) (mysqlHost *du.MysqlDB) {
|
||||
@@ -20,7 +19,7 @@ func expandLocalMysql(port int) (mysqlHost *du.MysqlDB) {
|
||||
return
|
||||
}
|
||||
|
||||
func querySessionInfo(snifferPort int, clientHost string) (user, db *string, err error) {
|
||||
func querySessionInfo(snifferPort int, clientHost *string) (user, db *string, err error) {
|
||||
mysqlServer := expandLocalMysql(snifferPort)
|
||||
querySQL := fmt.Sprintf(
|
||||
"SELECT user, db FROM information_schema.processlist WHERE host='%s'", clientHost)
|
||||
|
Reference in New Issue
Block a user