Adding option --dbstat to display database information

This commit is contained in:
root 2015-06-19 10:39:35 +02:00
parent 6c3197eb89
commit 3b183ab148

View file

@ -65,6 +65,7 @@ my %opt = (
"buffers" => 0, "buffers" => 0,
"passwordfile" => 0, "passwordfile" => 0,
"reportfile" => 0, "reportfile" => 0,
"dbstat" => 0,
); );
@ -91,6 +92,7 @@ GetOptions(\%opt,
'passwordfile=s', 'passwordfile=s',
'reportfile=s', 'reportfile=s',
'silent', 'silent',
'dbstat',
); );
if (defined $opt{'help'} && $opt{'help'} == 1) { usage(); } if (defined $opt{'help'} && $opt{'help'} == 1) { usage(); }
@ -1246,6 +1248,9 @@ sub mysql_innodb {
# Recommandations for Innodb # Recommandations for Innodb
sub mysql_databases { sub mysql_databases {
if ($opt{dbstat} == 0) {
return;
}
prettyprint "\n-------- Database Metrics ------------------------------------------------\n"; prettyprint "\n-------- Database Metrics ------------------------------------------------\n";
unless (mysql_version_ge(5,5)) { unless (mysql_version_ge(5,5)) {
infoprint "Skip Database metrics from information schema \n"; infoprint "Skip Database metrics from information schema \n";