Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to plot neqo's MOZ_LOG output from the congestion controller #1536

Merged
merged 5 commits into from
Feb 7, 2024

Conversation

mb
Copy link
Member

@mb mb commented Jan 3, 2024

This script can visualize MOZ_LOGs

  • 'HTTP/3 upload speed' in about:logging
  • log modules: timestamp,neqo_transport::*:3

Using the directory performance-test from #1529
Moving the script from https://github.com/mb/scripts/blob/5a72b00cda615a9ea940f0f93efeacb422807ec0/visualize/mozlog-neqo-cwnd.py
Example output: https://bugzilla.mozilla.org/show_bug.cgi?id=1852924#c36

@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (10e5284) 92.84% compared to head (2ff069e) 92.83%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1536      +/-   ##
==========================================
- Coverage   92.84%   92.83%   -0.01%     
==========================================
  Files         120      120              
  Lines       36770    36686      -84     
==========================================
- Hits        34140    34059      -81     
+ Misses       2630     2627       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martinthomson martinthomson removed their request for review January 4, 2024 00:53
@martinthomson
Copy link
Member

I think that I'll let @KershawChang handle this one.

Copy link
Collaborator

@KershawChang KershawChang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need another graph to show the change of RTT.

# allow garbage data before timestamp
timestamp = line.split(" UTC", 1)[0].split(' ')
timestamp = timestamp[-2] + " " + timestamp[-1]
return datetime.strptime(timestamp, "%Y-%m-%d %H:%M:%S.%f")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is script is for MOZ_LOG, but can we also make this script works with RUST_LOG?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I use RUST_LOG I don't see a timestamp in the line. I do depend on timestamps generated by MOZ_LOG. Can you give an example line that you are using?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can get updated in a followup PR. I don't know right now how the log line would look like. I think this PR can get merged before fixing that.

# plot pn graph
def graph_pn(ax, output_data):
for event in ['packet_sent', 'packet_acked', 'packet_lost']:
ax.scatter(output_data["ps"][event]["time"], output_data["ps"][event]["pn"], label=event, s=10, color=COLORS[event])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that this graph is not easy to read.
My only suggestion is to try adding a small tooltip for each dot that only appears when the mouse hovers over it.
Like this:
Screenshot 2024-01-08 at 5 15 05 PM

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look at adding tooltips to points with that info. Seems reasonable 👍 and will add an RTT graph as discussed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interactive matplotlib is a bit too complex for the current graph. Using the rectangle tool is a workaround for now. I'll put this as out of scope for this PR.

performance-test/mozlog-neqo-cwnd.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@larseggert larseggert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get one warning from pylance. You should also consider running this though black to apply consistent formatting.

performance-test/mozlog-neqo-cwnd.py Outdated Show resolved Hide resolved
@larseggert
Copy link
Collaborator

@mb could we please get the comments addressed so this can be merged?

@mb mb force-pushed the pr-add-script branch 2 times, most recently from 25db97b to e7f9a93 Compare February 7, 2024 13:53
@mb
Copy link
Member Author

mb commented Feb 7, 2024

Done. Formatted with black. I think current unaddressed review comments are better addressed in a follow up PR.

Copy link
Collaborator

@larseggert larseggert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this to the test directory, and update the README there? Having test and performance-test seems redundant.

@mb
Copy link
Member Author

mb commented Feb 7, 2024

Done. I simply mentioned it in the README with an example on how to call it. Is there something else you would like in the README?

@larseggert larseggert merged commit b547c6f into mozilla:main Feb 7, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants