mirror of
https://github.com/zr-hebo/sniffer-agent.git
synced 2025-09-19 02:06:52 +08:00
修改buffer pool大小
This commit is contained in:
@@ -2,7 +2,6 @@ package model
|
||||
|
||||
import (
|
||||
"github.com/pingcap/tidb/util/hack"
|
||||
"time"
|
||||
)
|
||||
|
||||
// MysqlQueryPiece 查询信息
|
||||
@@ -19,36 +18,6 @@ type MysqlQueryPiece struct {
|
||||
CostTimeInMS int64 `json:"cms"`
|
||||
}
|
||||
|
||||
type PooledMysqlQueryPiece struct {
|
||||
MysqlQueryPiece
|
||||
recoverPool *mysqlQueryPiecePool
|
||||
sliceBufferPool *sliceBufferPool
|
||||
}
|
||||
|
||||
func NewPooledMysqlQueryPiece(
|
||||
sessionID, clientIP, visitUser, visitDB, serverIP *string,
|
||||
clientPort, serverPort int, throwPacketRate float64, stmtBeginTime int64) (
|
||||
mqp *PooledMysqlQueryPiece) {
|
||||
mqp = mqpp.Dequeue()
|
||||
|
||||
nowInMS := time.Now().UnixNano() / millSecondUnit
|
||||
mqp.SessionID = sessionID
|
||||
mqp.ClientHost = clientIP
|
||||
mqp.ClientPort = clientPort
|
||||
mqp.ServerIP = serverIP
|
||||
mqp.ServerPort = serverPort
|
||||
mqp.VisitUser = visitUser
|
||||
mqp.VisitDB = visitDB
|
||||
mqp.SyncSend = false
|
||||
mqp.CapturePacketRate = throwPacketRate
|
||||
mqp.BeginTime = stmtBeginTime
|
||||
mqp.CostTimeInMS = nowInMS - stmtBeginTime
|
||||
mqp.recoverPool = mqpp
|
||||
mqp.sliceBufferPool = localSliceBufferPool
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (mqp *MysqlQueryPiece) String() (*string) {
|
||||
content := mqp.Bytes()
|
||||
contentStr := hack.String(content)
|
||||
@@ -73,9 +42,3 @@ func (mqp *MysqlQueryPiece) GenerateJsonBytes() {
|
||||
func (mqp *MysqlQueryPiece) GetSQL() (str *string) {
|
||||
return mqp.QuerySQL
|
||||
}
|
||||
|
||||
func (pmqp *PooledMysqlQueryPiece) Recovery() {
|
||||
// pmqp.sliceBufferPool.Enqueue(pmqp.jsonContent[:0])
|
||||
pmqp.jsonContent = nil
|
||||
pmqp.recoverPool.Enqueue(pmqp)
|
||||
}
|
||||
|
Reference in New Issue
Block a user