mirror of
https://github.com/zr-hebo/sniffer-agent.git
synced 2025-10-09 22:29:50 +08:00
add response parse module
This commit is contained in:
@@ -16,6 +16,8 @@ type MysqlQueryPiece struct {
|
||||
VisitDB *string `json:"db"`
|
||||
QuerySQL *string `json:"sql"`
|
||||
CostTimeInMS int64 `json:"cms"`
|
||||
OK int64 `json:"ok"`
|
||||
ResponseVal int64 `json:"rv"`
|
||||
}
|
||||
|
||||
func (mqp *MysqlQueryPiece) String() (*string) {
|
||||
@@ -42,3 +44,8 @@ func (mqp *MysqlQueryPiece) GenerateJsonBytes() {
|
||||
func (mqp *MysqlQueryPiece) GetSQL() (str *string) {
|
||||
return mqp.QuerySQL
|
||||
}
|
||||
|
||||
func (mqp *MysqlQueryPiece) SetResponse(ok, respVal int64) {
|
||||
mqp.OK = ok
|
||||
mqp.ResponseVal = respVal
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ type QueryPiece interface {
|
||||
GetSQL() *string
|
||||
NeedSyncSend() bool
|
||||
Recovery()
|
||||
SetResponse(int64, int64)
|
||||
}
|
||||
|
||||
// BaseQueryPiece 查询信息
|
||||
@@ -80,6 +81,9 @@ func (bqp *BaseQueryPiece) GetSQL() (*string) {
|
||||
func (bqp *BaseQueryPiece) Recovery() {
|
||||
}
|
||||
|
||||
func (bqp *BaseQueryPiece) SetResponse(ok, respVal int64) {
|
||||
}
|
||||
|
||||
/**
|
||||
func marsharQueryPieceShareMemory(qp interface{}, cacheBuffer []byte) []byte {
|
||||
buffer := bytes.NewBuffer(cacheBuffer)
|
||||
|
@@ -29,6 +29,8 @@ func NewPooledMysqlQueryPiece(
|
||||
pmqp.EventTime = stmtBeginTime
|
||||
pmqp.CostTimeInMS = nowInMS - stmtBeginTime
|
||||
pmqp.recoverPool = mqpp
|
||||
pmqp.OK = 0
|
||||
pmqp.ResponseVal = -1
|
||||
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user