Skip to content

Instantly share code, notes, and snippets.

@rothgar
Last active March 9, 2021 17:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rothgar/0d7e3a9c11f2cb85f247b0a9eacf2541 to your computer and use it in GitHub Desktop.
Save rothgar/0d7e3a9c11f2cb85f247b0a9eacf2541 to your computer and use it in GitHub Desktop.
# ping once per minute. Every minute for a day
ping -i 60 -c 1440 google.com | grep loss | awk -F ',' '{print $3}'
# print avg latency (ms) per hour. One ping per minute
ping -i 60 -c 60 google.com | awk '{print $8}' | sed -n '/^time/p' | awk -F '=' '{print $2}' | awk '{ sum += $1 } END { if (NR > 0) print sum / NR }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment