Skip to content

Instantly share code, notes, and snippets.

@samlambert
Last active December 14, 2015 12:48
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samlambert/5089207 to your computer and use it in GitHub Desktop.
Save samlambert/5089207 to your computer and use it in GitHub Desktop.
One liner to print MySQL Queries Per Second.
mysqladmin ext -i1 | gawk '/Queries/{q=$4-ql;ql=$4; printf("%s QPS: %s\n", strftime("%H:%M:%S"), q)}'
@samlambert
Copy link
Author

Output to file:

sudo mysqladmin ext -i1 | gawk '/Queries/{q=$4-ql;ql=$4; printf("%s %s\n", strftime("%H:%M:%S"), q, fflush())}' | tee qps.dat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment