Skip to content

Instantly share code, notes, and snippets.

@BenjaminKim
Last active September 7, 2017 15:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save BenjaminKim/6590816 to your computer and use it in GitHub Desktop.
Save BenjaminKim/6590816 to your computer and use it in GitHub Desktop.
Calculate average of response time in Rails 3 server.
cat log/production.log| grep "^Completed .* in [0-9]*ms .*" | sed "s/.* in \([0-9]*\)ms.*/\1/" | awk '{ s += $1 } END { print "sum: ", s, " average: ", s/NR, " samples: ", NR }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment