Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

feat: Add Ping command to monitor workspace latency #409

Merged
merged 15 commits into from
Aug 9, 2021
Merged

feat: Add Ping command to monitor workspace latency #409

merged 15 commits into from
Aug 9, 2021

Conversation

kylecarbs
Copy link
Member

@kylecarbs kylecarbs commented Aug 9, 2021

[ch13708]

asciicast

@kylecarbs kylecarbs requested a review from f0ssel August 9, 2021 04:02
return err
}

fmt.Printf("%.2fms (%s) seq=%d\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

not needed for an MVP, of course, but would be nice if this printed stats when the user quit, like the actual ping command:

$ ping -c 3 google.com
PING google.com(sfo03s24-in-x0e.1e100.net (2607:f8b0:4005:80c::200e)) 56 data bytes
64 bytes from sfo03s24-in-x0e.1e100.net (2607:f8b0:4005:80c::200e): icmp_seq=1 ttl=118 time=10.8 ms
64 bytes from sfo03s24-in-x0e.1e100.net (2607:f8b0:4005:80c::200e): icmp_seq=2 ttl=118 time=10.3 ms
64 bytes from sfo03s24-in-x0e.1e100.net (2607:f8b0:4005:80c::200e): icmp_seq=3 ttl=118 time=11.2 ms

--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 10.329/10.785/11.239/0.371 ms

also, what happens if we lose a ping response? this seems to assume the ping packets always come back, but that seems difficult to guarantee in general on a lossy network?

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 believe the Ping func would return an error and we'd exit... I'll check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in the latest iteration. Just like ping, failures will display inline.

We don't have stats yet, but that can be added later on!

@kylecarbs kylecarbs requested a review from jawnsy August 9, 2021 16:55
Copy link
Contributor

@jawnsy jawnsy left a comment

Choose a reason for hiding this comment

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

just really minor comments, I suggest just merging & we can iterate later if needed 🎉

@kylecarbs kylecarbs merged commit 9244ee8 into master Aug 9, 2021
@kylecarbs kylecarbs deleted the ping branch August 9, 2021 18:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants