Assembla home | Assembla project page
 

Changeset 32

Show
Ignore:
Timestamp:
02/27/08 03:07:15 (9 months ago)
Author:
major
Message:

Added lines between sections to increase readability.
Corrected a bug where storage engine statuses were still in color even with --nocolor.
Excluded information_schema tables from calculations (they were showing up as usual MEMORY tables).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mysqltuner.pl

    r31 r32  
    8787sub infoprint { print $info." ".$_[0] unless ($opt{noinfo} == 1); } 
    8888sub badprint { print $bad." ".$_[0] unless ($opt{nobad} == 1); } 
    89 sub redwrap { return "\e[00;31m".$_[0]."\e[00m"; } 
    90 sub greenwrap { return "\e[00;32m".$_[0]."\e[00m"; } 
     89sub redwrap { return ($opt{nocolor} == 0)? "\e[00;31m".$_[0]."\e[00m" : $_[0] ; } 
     90sub greenwrap { return ($opt{nocolor} == 0)? "\e[00;32m".$_[0]."\e[00m" : $_[0] ; } 
    9191 
    9292# Calculates the parameter passed in bytes, and then rounds it to one decimal place 
     
    247247my ($mysqlvermajor,$mysqlverminor); 
    248248sub validate_mysql_version { 
    249         print "-------- General Statistics --------------------------------------------------\n"; 
     249        print "\n-------- General Statistics --------------------------------------------------\n"; 
    250250        ($mysqlvermajor,$mysqlverminor) = $myvar{'version'} =~ /(\d)\.(\d)/; 
    251251        if ($mysqlvermajor < 5) { 
     
    277277my (%enginestats,%enginecount); 
    278278sub check_storage_engines { 
    279         print "-------- Storage Engine Statistics -------------------------------------------\n"; 
     279        print "\n-------- Storage Engine Statistics -------------------------------------------\n"; 
    280280        infoprint "Status: "; 
    281281        my $engines; 
     
    292292        foreach my $db (@dblist) { 
    293293                chomp($db); 
     294                if ($db eq "information_schema") { next; } 
    294295                if ($mysqlvermajor == 3 || ($mysqlvermajor == 4 && $mysqlverminor == 0)) { 
    295296                        # MySQL 3.23/4.0 keeps Data_Length in the 6th column 
     
    457458 
    458459sub mysql_stats { 
    459         print "-------- Performance Metrics -------------------------------------------------\n"; 
     460        print "\n-------- Performance Metrics -------------------------------------------------\n"; 
    460461        # Show uptime, queries per second, connections, traffic stats 
    461462        my $qps; 
     
    662663# Take the two recommendation arrays and display them at the end of the output 
    663664sub make_recommendations { 
    664         print "-------- Recommendations -----------------------------------------------------\n"; 
     665        print "\n-------- Recommendations -----------------------------------------------------\n"; 
    665666        if (@generalrec > 0) { 
    666667                print "General recommendations:\n"; 
     
    678679                print "No additional performance recommendations are available.\n" 
    679680        } 
     681        print "\n"; 
    680682} 
    681683 
     
    683685# BEGIN 'MAIN' 
    684686# --------------------------------------------------------------------------- 
    685 print   " >>  MySQLTuner $tunerversion - Major Hayden <major\@mhtx.net>\n". 
     687print   "\n >>  MySQLTuner $tunerversion - Major Hayden <major\@mhtx.net>\n". 
    686688                " >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/\n". 
    687689                " >>  Run with '--help' for additional options and output filtering\n";