Skip to content

Instantly share code, notes, and snippets.

@justdoit0823
Last active January 24, 2021 14:21
Show Gist options
  • Save justdoit0823/9cae26ec950ece65b0896a930fd956f7 to your computer and use it in GitHub Desktop.
Save justdoit0823/9cae26ec950ece65b0896a930fd956f7 to your computer and use it in GitHub Desktop.
Simple summary stat with awk.
// min, mean, max, p50, p90, p99, p999
sort -k1 -n|awk '{s[NR]=$1} END {print "min:"s[1], "mean:"s[int(NR * 0.5)], "p90:"s[int(NR * 0.9)], "p95:"s[int(NR * 0.95)], "p99:"s[int(NR * 0.99)], "p999:"s[int(NR * 0.999)], "max:"s[NR]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment