Repository navigation
fix(moq-transport): add time_format and reference_time to mlog header - #315
Open
cameronelliott wants to merge 1 commit into
Open
cameronelliott wants to merge 1 commit into
cameronelliott wants to merge 1 commit into
Conversation
The mlog header declares qlog_version 0.3. In qlog 0.3, a missing common_fields.time_format means "absolute", so each event's 'time' field should be an absolute timestamp, typically milliseconds since the Unix epoch. The code instead writes milliseconds since the mlog writer was created. The default of "absolute" is explained here: https://github.com/quicwg/qlog/blob/c2a302d9bf9b97c36e264ff1db42c14aa6e6705e/draft-ietf-quic-qlog-main-schema.md?plain=1#L631-L634 As written, event times cannot be converted to wall clock time. When they can, mlog traces from different connections or hosts can be placed on one timeline, which makes tools that analyze them possible. Write "relative" as the time_format, and reference_time as the Unix epoch milliseconds at which the writer started. Event times are already measured from that point, so only the header output changes; "absolute" or "delta" would change every event. Update the example header in MLOG_SETUP.md. Add a unit test: header_declares_relative_times_anchored_to_wall_clock()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The mlog header declares qlog_version 0.3. In qlog 0.3, a missing
common_fields.time_format means "absolute", so each event's 'time'
field should be an absolute timestamp, typically milliseconds since
the Unix epoch. The code instead writes milliseconds since the mlog
writer was created.
The default of "absolute" is explained here:
https://github.com/quicwg/qlog/blob/c2a302d9bf9b97c36e264ff1db42c14aa6e6705e/draft-ietf-quic-qlog-main-schema.md?plain=1#L631-L634
As written, event times cannot be converted to wall clock time. When
they can, mlog traces from different connections or hosts can be placed
on one timeline, which makes tools that analyze them possible.
Write "relative" as the time_format, and reference_time as the Unix
epoch milliseconds at which the writer started. Event times are
already measured from that point, so only the header output changes;
"absolute" or "delta" would change every event.
Update the example header in MLOG_SETUP.md.
Add a unit test:
header_declares_relative_times_anchored_to_wall_clock()
reference_time is rounded to whole microseconds, since an f64 of this
size cannot hold finer digits, and is left out if the clock reads
before 1970.
This only adds fields to the header. Existing fields and event records
are unchanged.
Validation: cargo fmt --check, cargo clippy --no-deps, cargo test and
cargo check --bins pass locally.