~percona-toolkit-dev/percona-toolkit/manual-for-pt-query-digest--type-binlog-is-ambiguous-1377888

« back to all changes in this revision

Viewing changes to bin/pt-mysql-summary

merged pt-mysql-summary-fails-to-parse-wsrep_provider_options-1264580

Show diffs side-by-side

added added

removed removed

Lines of Context:
1353
1353
 
1354
1354
   [ -e "$file" ] || return
1355
1355
 
1356
 
   awk '
1357
 
   BEGIN {
1358
 
      FS="="
1359
 
   }
1360
 
   /^[ \t]*[a-zA-Z[]/ {
1361
 
      if (length($2)) {
1362
 
         gsub(/^[ \t]*/, "", $1);
1363
 
         gsub(/^[ \t]*/, "", $2);
1364
 
         gsub(/[ \t]*$/, "", $1);
1365
 
         gsub(/[ \t]*$/, "", $2);
1366
 
         printf("%-35s = %s\n", $1, $2);
1367
 
      }
1368
 
      else if ( $0 ~ /\[/ ) {
1369
 
         print "";
1370
 
         print $1;
1371
 
      }
1372
 
      else {
1373
 
         print $1;
1374
 
      }
1375
 
   }' "$file"
 
1356
   perl -n -l -e '
 
1357
      my $line = $_;
 
1358
      if ( $line =~ /^[ \t]*[a-zA-Z[]/ ) { 
 
1359
         if ( $line=~/\s*(.*?)\s*=\s*(.*)\s*$/ ) { 
 
1360
            printf("%-35s = %s\n", $1, $2)  
 
1361
         } 
 
1362
         elsif ( $line =~ /\s*\[/ ) { 
 
1363
            print "\n$line" 
 
1364
         } else {
 
1365
            print $line
 
1366
         } 
 
1367
      }' "$file"
 
1368
 
1376
1369
}
1377
1370
 
1378
1371
find_checkpoint_age() {