Skip to content

Commit

Permalink
Change RTT output to ns (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
dushyantbehl committed Aug 1, 2023
1 parent 7513aa9 commit 89f2c60
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/pipeline/decode/decode_protobuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ func PBFlowToMap(flow *pbflow.Record) config.GenericMap {
out["PktDropLatestDropCause"] = pktDropCauseToStr(flow.GetPktDropLatestDropCause())
}

if flow.TimeFlowRtt.AsDuration().Milliseconds() != 0 {
out["TimeFlowRttMs"] = flow.TimeFlowRtt.AsDuration().Milliseconds()
if flow.TimeFlowRtt.AsDuration().Nanoseconds() != 0 {
out["TimeFlowRttNs"] = flow.TimeFlowRtt.AsDuration().Nanoseconds()
}
return out
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/pipeline/decode/decode_protobuf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestDecodeProtobuf(t *testing.T) {
"DnsId": uint32(1),
"DnsFlags": uint32(0x8001),
"DnsFlagsResponseCode": "FormErr",
"TimeFlowRttMs": someDuration.Milliseconds(),
"TimeFlowRttNs": someDuration.Nanoseconds(),
}, out)
}

Expand Down Expand Up @@ -171,7 +171,7 @@ func TestPBFlowToMap(t *testing.T) {
"DnsId": uint32(1),
"DnsFlags": uint32(0x80),
"DnsFlagsResponseCode": "NoError",
"TimeFlowRttMs": someDuration.Milliseconds(),
"TimeFlowRttNs": someDuration.Nanoseconds(),
}, out)

}
2 changes: 1 addition & 1 deletion pkg/pipeline/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ parameters:
"DnsId": float64(1),
"DnsFlags": float64(0x80),
"DnsFlagsResponseCode": "NoError",
"TimeFlowRttMs": float64(someDuration.Milliseconds()),
"TimeFlowRttNs": float64(someDuration.Nanoseconds()),
}, capturedRecord)
}

Expand Down

0 comments on commit 89f2c60

Please sign in to comment.