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

Filter out None points when calculating RTT #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RascalTwo
Copy link

Fix #14


Filter's out the None points from latency_points to prevent the min, mean, and max from receiving any None values and throwing an error.

If preferred, I could use filter() over the list comprehension I used:

received_points = list(filter(bool, latency_points))

Fix dgzlopes#14

Signed-off-by: Rascal_Two <therealrascaltwo@gmail.com>
Copy link
Owner

@dgzlopes dgzlopes left a comment

Choose a reason for hiding this comment

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

Good catch @RascalTwo. Thanks a lot for the fix! LGTM.

I prefer the list comprehension, is more Pythonic 💯

On the other hand, can you add the changes for solving last latency_point not being included in RTT calculations issue?. If not, I can create one PR with the fix.

@RascalTwo
Copy link
Author

Thanks, glad you like it - I also prefer the list comprehension too.

Would you prefer the last latency_point not being included in RTT calculations fix as a second commit to this PR or squashed into the one commit?

Signed-off-by: Rascal_Two <therealrascaltwo@gmail.com>
@dgzlopes
Copy link
Owner

dgzlopes commented Oct 1, 2020

Feel free to add a second commit. I can Squash and merge from the Github UI.

@RascalTwo
Copy link
Author

All done - thanks for sharing this project and taking the time to review!

@jbarbaran
Copy link

Is this branch going to be merged with master?

@zatricky
Copy link

Would the None values indicate packet loss or timeouts? If so I'd consider that information useful. It's understandable if you're okay with simply discarding it - but it would be useful toward understand the situation with connectivity to an endpoint (which is the most likely reason someone is using tcp-latency in the first place).

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.

CLI error calculating RTT when any latency point is None
4 participants