Fix response latency calculation

Previously latency calcualted as Response.End - Request.Start
Where both End and Start is a last and first packets

This calcualtion is wrong, because it is total roundtrip

Correct server latency will be Response.End - Request.End

In addition added new `--input-raw-timestamp-type` option
which allows choose more precise packet timestamp source (if available).
This commit is contained in:
Leonid Bugaev
2018-02-05 21:47:48 +02:00
parent f8a1b9dde6
commit 0097c599df
14 changed files with 70 additions and 47 deletions
+2 -2
View File
@@ -118,7 +118,7 @@ func TestEchoMiddleware(t *testing.T) {
// Catch traffic from one service
fromAddr := strings.Replace(from.Listener.Addr().String(), "[::]", "127.0.0.1", -1)
input := NewRAWInput(fromAddr, EnginePcap, true, testRawExpire, "", "")
input := NewRAWInput(fromAddr, EnginePcap, true, testRawExpire, "", "", "")
defer input.Close()
// And redirect to another
@@ -180,7 +180,7 @@ func TestTokenMiddleware(t *testing.T) {
fromAddr := strings.Replace(from.Listener.Addr().String(), "[::]", "127.0.0.1", -1)
// Catch traffic from one service
input := NewRAWInput(fromAddr, EnginePcap, true, testRawExpire, "", "")
input := NewRAWInput(fromAddr, EnginePcap, true, testRawExpire, "", "", "")
defer input.Close()
// And redirect to another