Prevent elapsedTime to be negative (#467)

Also fix the `elapsedTime` for Redis.
This commit is contained in:
M. Mert Yıldıran
2021-11-16 02:52:48 +03:00
committed by GitHub
parent 58a1eac247
commit a6bf39fad5
3 changed files with 12 additions and 1 deletions

View File

@@ -149,6 +149,9 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string,
request["url"] = summary
elapsedTime := item.Pair.Response.CaptureTime.Sub(item.Pair.Request.CaptureTime).Round(time.Millisecond).Milliseconds()
if elapsedTime < 0 {
elapsedTime = 0
}
return &api.MizuEntry{
Protocol: _protocol,
Source: &api.TCP{