Skip to content

Instantly share code, notes, and snippets.

@lazybios
Forked from BenjaminKim/gist:6590816
Created October 6, 2015 09:39
Show Gist options
  • Save lazybios/e58a0e208b804e6c368a to your computer and use it in GitHub Desktop.
Save lazybios/e58a0e208b804e6c368a 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