-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve ping script output readability #45
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is simpler, but it does remove some functionality, tho the need for that functionality is an edge case.
The new style seems to expect one or none ping responses between sent pings while the old style could handle receiving any response at any time.
Previously each ping iteration could print up to three lines, and it was sometimes easy to miss if the latest iteration succeeded or failed. This tries to limit each iteration to only a single vertically aligned line, printing information as it comes in. While I was here I simplified the implementation: - By being a little more careful about where and how long blocking happens I was able to drop multiple threads. This makes coordinating printing lines and shared data much easier - Removed previous loop timestamp tracking, it didn't seem to work anyway?
ac2696d
to
aa64c7d
Compare
Adds back the capability to handle ping responses that are batched (for example try to a local c3 with the argument -l 25), and also some amount of handling for stranger anomalous conditions. Display has been now separated out from the logic, class Link handles the meaty bits and ping_loop() runs the top level loop and displays the output. Output has been enhanced with unicode and the ability to handle batched received packets. Adds a --count argument to stop after attempting to send count pings
5c5fcda
to
756753d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I would change a couple variable names for readability, tho it shouldn't block the merge
scripts/edl_ping_loop.py
Outdated
self.echo = 0 | ||
self.seqn = seqn | ||
self.hmac = hmac | ||
self.stim: OrderedDict[int, float] = OrderedDict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use a longer name than stim for readability
scripts/edl_ping_loop.py
Outdated
|
||
self.sent = 0 | ||
self.echo = 0 | ||
self.seqn = seqn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change this to seq_num or sequence_number for readability
Also fixed spacing on the column header.
Previously each ping iteration could print up to three lines, and it was sometimes easy to miss if the latest iteration succeeded or failed. This tries to limit each iteration to only a single vertically aligned line, printing information as it comes in.
While I was here I simplified the implementation: