Skip to content

Commit

Permalink
fix: use ntp servers time as timestamp of ntp offset (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongfei605 authored Feb 24, 2024
1 parent 209388d commit 6ab3751
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inputs/ntp/ntp.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (n *NTPStat) Gather(slist *types.SampleList) {
duration := ((serverReciveTime.UnixNano() - orgTime.UnixNano()) + (serverTransmitTime.UnixNano() - dstTime.UnixNano())) / 2

delta := duration / 1e6 // convert to ms
slist.PushSample("", "ntp_offset_ms", delta)
slist.PushFront(types.NewSample(inputName, "offset_ms", delta).SetTime(serverTransmitTime))
break
}
}

0 comments on commit 6ab3751

Please sign in to comment.