feat(measurexlite): Trace now implements MeasuringNetwork #1262
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.
This diff is still yak shaving for ooni/probe#2531 but produces some nice side effects. Now, we can either use netxlite.Netx or measurexlite.Trace as a dependency for measuring code.
The cost of this change is (1) switching some functions to use a
model.DebugLogger
, which is not an issue, and (2) adding some optional wrappers to other functions. I made these functions to ignore the wrappers and documented this limitation, because measurexlite code does not need this functionality. It is a bit debateable whether this is the best way to implement this change, but I am doing this because I would like to see these wrappers gone when we stop using legacy/netx in the codebase, so I think it's fine to ignore them, to better signal they're deprecated stuff.This change is absolutely in line with the original spirit of measurexlite because it's now much simpler to write code for netxlite and then upgrade to measurexlite.
I noticed this possibility yesterday while working on a much larger diff, and now I am committing this smaller diff to start the working day.