Created
April 26, 2011 22:28
-
-
Save wimleers/943336 to your computer and use it in GitHub Desktop.
Script to automatically analyze slow queries of last hour and last 24 hours, using mk-query-digest.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
INPUT=/var/log/mysql/mysql-slow.log | |
OUTPUT_1H=/data/www/wimleers.com/status/mysql-slow-1h.txt | |
OUTPUT_24H=/data/www/wimleers.com/status/mysql-slow-24h.txt | |
# Perform the analytics, overwriting the previous results. | |
../scripts/mk-query-digest --since 1h $INPUT > $OUTPUT_1H | |
../scripts/mk-query-digest --since 24h $INPUT > $OUTPUT_24H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment