优化性能

This commit is contained in:
hebo
2019-08-13 15:51:33 +08:00
parent c42113b8f8
commit f8a85e0af6
15 changed files with 234 additions and 112 deletions

View File

@@ -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)