Skip to content

Commit 89f2c60

Browse files
authored
Change RTT output to ns (#468)
1 parent 7513aa9 commit 89f2c60

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pkg/pipeline/decode/decode_protobuf.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ func PBFlowToMap(flow *pbflow.Record) config.GenericMap {
8888
out["PktDropLatestDropCause"] = pktDropCauseToStr(flow.GetPktDropLatestDropCause())
8989
}
9090

91-
if flow.TimeFlowRtt.AsDuration().Milliseconds() != 0 {
92-
out["TimeFlowRttMs"] = flow.TimeFlowRtt.AsDuration().Milliseconds()
91+
if flow.TimeFlowRtt.AsDuration().Nanoseconds() != 0 {
92+
out["TimeFlowRttNs"] = flow.TimeFlowRtt.AsDuration().Nanoseconds()
9393
}
9494
return out
9595
}

pkg/pipeline/decode/decode_protobuf_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func TestDecodeProtobuf(t *testing.T) {
9393
"DnsId": uint32(1),
9494
"DnsFlags": uint32(0x8001),
9595
"DnsFlagsResponseCode": "FormErr",
96-
"TimeFlowRttMs": someDuration.Milliseconds(),
96+
"TimeFlowRttNs": someDuration.Nanoseconds(),
9797
}, out)
9898
}
9999

@@ -171,7 +171,7 @@ func TestPBFlowToMap(t *testing.T) {
171171
"DnsId": uint32(1),
172172
"DnsFlags": uint32(0x80),
173173
"DnsFlagsResponseCode": "NoError",
174-
"TimeFlowRttMs": someDuration.Milliseconds(),
174+
"TimeFlowRttNs": someDuration.Nanoseconds(),
175175
}, out)
176176

177177
}

pkg/pipeline/pipeline_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ parameters:
251251
"DnsId": float64(1),
252252
"DnsFlags": float64(0x80),
253253
"DnsFlagsResponseCode": "NoError",
254-
"TimeFlowRttMs": float64(someDuration.Milliseconds()),
254+
"TimeFlowRttNs": float64(someDuration.Nanoseconds()),
255255
}, capturedRecord)
256256
}
257257

0 commit comments

Comments
 (0)