~percona-toolkit-dev/percona-toolkit/fix-dl-ts-bug-1195034

« back to all changes in this revision

Viewing changes to bin/pt-query-digest

  • Committer: Brian Fraser
  • Date: 2013-04-16 20:48:05 UTC
  • mfrom: (571.5.1 percona-toolkit)
  • Revision ID: brian.fraser@percona.com-20130416204805-ercplkuen4d6emcv
Merged fix-1160918-restore-show-all

Show diffs side-by-side

added added

removed removed

Lines of Context:
6525
6525
   default => sub { [qw(pct total min max avg 95% stddev median)] },
6526
6526
);
6527
6527
 
 
6528
has show_all => (
 
6529
   is      => 'ro',
 
6530
   isa     => 'HashRef',
 
6531
   default => sub { {} },
 
6532
);
 
6533
 
6528
6534
has ReportFormatter => (
6529
6535
   is      => 'ro',
6530
6536
   isa     => 'ReportFormatter',
7404
7410
 
7405
7411
sub format_string_list {
7406
7412
   my ( $self, $attrib, $vals, $class_cnt ) = @_;
7407
 
 
 
7413
   
7408
7414
   if ( !exists $vals->{unq} ) {
7409
7415
      return ($vals->{cnt});
7410
7416
   }
7411
7417
 
 
7418
   my $show_all = $self->show_all();
 
7419
 
7412
7420
   my $cnt_for = $vals->{unq};
7413
7421
   if ( 1 == keys %$cnt_for ) {
7414
7422
      my ($str) = keys %$cnt_for;
7433
7441
      }
7434
7442
      my $p = percentage_of($cnt_for->{$str}, $class_cnt);
7435
7443
      $print_str .= " ($cnt_for->{$str}/$p%)";
 
7444
      if ( !$show_all->{$attrib} ) {
 
7445
         last if (length $line) + (length $print_str)  > LINE_LENGTH - 27;
 
7446
      }
7436
7447
      $line .= "$print_str, ";
7437
7448
      $i++;
7438
7449
   }
13764
13775
   my @groupby = @{$args{groupby}};
13765
13776
   my @orderby = @{$args{orderby}};
13766
13777
 
 
13778
   my $show_all = $o->get('show-all');
 
13779
 
13767
13780
   for my $i ( 0..$#groupby ) {
13768
13781
      if ( $o->get('report') || $qv || $qh ) {
13769
13782
         $eas->[$i]->calculate_statistical_metrics();
13814
13827
            OptionParser  => $args{OptionParser},
13815
13828
            QueryParser   => $args{QueryParser},
13816
13829
            Quoter        => $args{Quoter},
 
13830
            show_all      => $show_all,
13817
13831
         );
13818
13832
 
13819
13833
         $qrf->print_reports(
15517
15531
 
15518
15532
The tool prints a warning and continues if a variable cannot be set.
15519
15533
 
 
15534
=item --show-all
 
15535
 
 
15536
type: Hash
 
15537
 
 
15538
Show all values for these attributes.
 
15539
 
 
15540
By default pt-query-digest only shows as many of an attribute's value that
 
15541
fit on a single line.  This option allows you to specify attributes for which
 
15542
all values will be shown (line width is ignored).  This only works for
 
15543
attributes with string values like user, host, db, etc.  Multiple attributes
 
15544
can be specified, comma-separated.
 
15545
 
15520
15546
=item --since
15521
15547
 
15522
15548
type: string