[testbed/datasenders] add missing 0 to nanoseconds calculation #33321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Fixing a bug - the calculation when converting pdata timestamps to
time
is off in both thesyslog
andtcpudp
datasenders.Seconds are calculated correctly by dividing the timestamp by
10^9
, but in nanosecond calculation the remainder oftimestamp/10^8
is used, effectively always setting the first decimal in the resulting timestamp to0
.Discovered this while writing some tests against the syslog receiver and receiving unexpected data in the log body, after identifying the issue a quick search revealed that the same thing was happening in the tcp/upd datasender.
Example:
2024-05-31T11:53:54.612287004+02:00
becomes2024-05-31T11:53:54.012287004+02:00
Link to tracking Issue: no issue as it's a fairly minor thing that only affects tests, but can open if required
Testing:
Documentation: no additional documentation added.