Merge pull request #4 from zr-hebo/develop-hebo

统一抓包率名称
This commit is contained in:
河伯 2019-10-11 18:02:11 +08:00 committed by GitHub
commit eed5eee6d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View File

@ -27,7 +27,7 @@ func init() {
catpurePacketRate = newCapturePacketRateConfig()
flag.IntVar(&communicatePort, "communicate_port", 8088, "http server port. Default is 8088")
flag.Float64Var(&catpurePacketRateVal, CAPTURE_PACKET_RATE, 0.01, "capture packet rate. Default is 0.01")
flag.Float64Var(&catpurePacketRateVal, CAPTURE_PACKET_RATE, 1.0, "capture packet rate. Default is 1.0")
configMap = make(map[string]configItem)
}

View File

@ -41,7 +41,7 @@ func NewPooledMysqlQueryPiece(
mqp.VisitUser = visitUser
mqp.VisitDB = visitDB
mqp.SyncSend = false
mqp.ThrowPacketRate = throwPacketRate
mqp.CapturePacketRate = throwPacketRate
mqp.BeginTime = stmtBeginTime
mqp.CostTimeInMS = nowInMS - stmtBeginTime
mqp.recoverPool = mqpp

View File

@ -20,12 +20,12 @@ type QueryPiece interface {
// BaseQueryPiece 查询信息
type BaseQueryPiece struct {
SyncSend bool `json:"-"`
ServerIP *string `json:"sip"`
ServerPort int `json:"sport"`
ThrowPacketRate float64 `json:"tpr"`
BeginTime int64 `json:"bt"`
jsonContent []byte `json:"-"`
SyncSend bool `json:"-"`
ServerIP *string `json:"sip"`
ServerPort int `json:"sport"`
CapturePacketRate float64 `json:"cpr"`
BeginTime int64 `json:"bt"`
jsonContent []byte `json:"-"`
}
const (
@ -40,13 +40,13 @@ var (
var commonBaseQueryPiece = &BaseQueryPiece{}
func NewBaseQueryPiece(
serverIP *string, serverPort int, throwPacketRate float64) (
serverIP *string, serverPort int, capturePacketRate float64) (
bqp *BaseQueryPiece) {
bqp = commonBaseQueryPiece
bqp.ServerIP = serverIP
bqp.ServerPort = serverPort
bqp.SyncSend = false
bqp.ThrowPacketRate = throwPacketRate
bqp.CapturePacketRate = capturePacketRate
bqp.BeginTime = time.Now().UnixNano() / millSecondUnit
return