Skip to content

Commit

Permalink
fix: fix latency filter bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hengyoush committed Jan 6, 2025
1 parent 73c8585 commit 7a35b57
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions agent/conn/record_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,10 @@ func submitRecord(record protocol.Record, c *Connection4) {
var needSubmit bool

needSubmit = c.MessageFilter.FilterByProtocol(c.Protocol)
var duration uint64
if c.IsServerSide() {
duration = record.Request().TimestampNs() - record.Response().TimestampNs()
} else {
duration = record.Response().TimestampNs() - record.Request().TimestampNs()
}

duration := record.Response().TimestampNs() - record.Request().TimestampNs()
needSubmit = needSubmit && c.LatencyFilter.Filter(float64(duration)/1000000)

needSubmit = needSubmit &&
c.SizeFilter.FilterByReqSize(int64(record.Request().ByteSize())) &&
c.SizeFilter.FilterByRespSize(int64(record.Response().ByteSize()))
Expand Down

0 comments on commit 7a35b57

Please sign in to comment.