Skip to content

Commit

Permalink
inconsistent performance schema info major#167
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdknaap committed Mar 24, 2016
1 parent 9c87b52 commit 58807c1
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions mysqltuner.pl
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ package main;
"noask" => 0,
"template" => 0,
"json" => 0,
"reportfile" => 0,
"prettyjson" => 0
"prettyjson" => 0,
"reportfile" => 0
);

# Gather the options from the command line
Expand All @@ -93,9 +93,10 @@ package main;
'host=s', 'socket=s', 'port=i', 'user=s',
'pass=s', 'skipsize', 'checkversion', 'mysqladmin=s',
'mysqlcmd=s', 'help', 'buffers', 'skippassword',
'passwordfile=s', 'outputfile=s', 'silent', 'dbstat', 'json',
'idxstat', 'noask', 'template=s', 'reportfile=s', 'cvefile=s',
'bannedports=s','maxportallowed=s','prettyjson'
'passwordfile=s', 'outputfile=s', 'silent', 'dbstat',
'json', 'prettyjson', 'idxstat', 'noask',
'template=s', 'reportfile=s', 'cvefile=s', 'bannedports=s',
'maxportallowed=s'
);

if ( defined $opt{'help'} && $opt{'help'} == 1 ) { usage(); }
Expand Down Expand Up @@ -191,7 +192,7 @@ sub usage {

# Functions that handle the print styles
sub prettyprint {
print $_[0] . "\n" unless $opt{'silent'};
print $_[0] . "\n" unless ($opt{'silent'} or $opt{'json'});
print $fh $_[0] . "\n" if defined($fh);
}
sub goodprint { prettyprint $good. " " . $_[0] unless ( $opt{nogood} == 1 ); }
Expand Down Expand Up @@ -388,7 +389,7 @@ sub os_setup {
# Checks for updates to MySQLTuner
sub validate_tuner_version {
if ($opt{checkversion} eq 0) {
print "\n";
print "\n" unless ($opt{'silent'} or $opt{'json'});
infoprint "Skipped version check for MySQLTuner script";
return;
}
Expand Down Expand Up @@ -2541,9 +2542,9 @@ sub mysqsl_pfs {
# Performance Schema
unless ( defined($myvar{'performance_schema'}) and $myvar{'performance_schema'} eq 'ON' ) {
infoprint "Performance schema is disabled.";
} else {
infoprint "Performance schema is enabled.";
}

infoprint "Performance schema is enabled.";
}


Expand Down Expand Up @@ -2909,7 +2910,7 @@ sub mysql_databases {
$result{'Databases'}{'All databases'}{'Index Pct'} =
percentage( $totaldbinfo[2], $totaldbinfo[3] ) . "%";
$result{'Databases'}{'All databases'}{'Total Size'} = $totaldbinfo[3];
print "\n";
print "\n" unless ($opt{'silent'} or $opt{'json'});
foreach (@dblist) {
chomp($_);
if ( $_ eq "information_schema"
Expand Down Expand Up @@ -3210,7 +3211,7 @@ sub dump_result {
exit 1;
}
my $json = JSON->new->allow_nonref;
print $json->utf8(1)->pretty((defined $opt{'prettyjson'} ? 1 : 0))->encode(\%result);
print $json->utf8(1)->pretty(($opt{'prettyjson'} ? 1 : 0))->encode(\%result);
}
}

Expand Down

0 comments on commit 58807c1

Please sign in to comment.