Created
June 11, 2012 17:16
-
-
Save jayjanssen/2911398 to your computer and use it in GitHub Desktop.
Monitor checkpoint age on any Innodb server
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
#!/usr/bin/perl | |
#LOG | |
#--- | |
#Log sequence number 248 2222568315 | |
#Log flushed up to 248 2222533410 | |
#Last checkpoint at 248 1843690869 | |
# | |
use strict; | |
my $lsn; | |
my $checkpoint; | |
while( my $line = <STDIN> ) { | |
if( $line =~ m/^Log sequence number (\d+) (\d+)$/ ) { | |
$lsn = $2; | |
} elsif( $line =~ m/^Last checkpoint at \s*(\d+) (\d+)/ ) { | |
$checkpoint = $2; | |
} | |
} | |
#print "LSN: $lsn\n"; | |
#print "chkpt: $checkpoint\n"; | |
my $age = $lsn - $checkpoint; | |
my $age_mb = ($age / 1024) / 1024; | |
printf "Checkpoint Age: %.2dMB\n", $age_mb; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment