~percona-toolkit-dev/percona-toolkit/fix-1156867-pt-stalk-show-function-name

« back to all changes in this revision

Viewing changes to t/lib/QueryReportFormatter.t

  • Committer: Daniel Nichter
  • Date: 2013-03-09 17:24:56 UTC
  • mfrom: (530.3.18 clean-up-pqd-2.2)
  • Revision ID: daniel@percona.com-20130309172456-h0xhi9as8y1hsc0t
Merge clean-up-pqd-2.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
464
464
# #############################################################################
465
465
 
466
466
# This test uses the $ea from the Bool pretty printer test above.
467
 
my $sorted = $qrf->sort_attribs($ea->get_attributes(), $ea);
 
467
my $sorted = $qrf->sort_attribs($ea);
468
468
is_deeply(
469
469
   $sorted,
470
470
   {
511
511
}
512
512
$ea->calculate_statistical_metrics();
513
513
 
514
 
$sorted = $qrf->sort_attribs($ea->get_attributes(), $ea);
 
514
$sorted = $qrf->sort_attribs($ea);
515
515
is_deeply(
516
516
   $sorted,
517
517
   {
689
689
      "t/lib/samples/QueryReportFormatter/report010.txt",
690
690
      cmd_output => 1,
691
691
   ),
692
 
   'Truncate one long string'
 
692
   "Don't truncate one long string"
693
693
);
694
694
 
695
695
$ea->reset_aggregated_data();
721
721
      "t/lib/samples/QueryReportFormatter/report011.txt",
722
722
      cmd_output => 1,
723
723
   ),
724
 
   'Truncate multiple long strings'
 
724
   "Don't truncate multiple long strings"
725
725
);
726
726
 
727
727
$ea->reset_aggregated_data();
753
753
      "t/lib/samples/QueryReportFormatter/report012.txt",
754
754
      cmd_output => 1,
755
755
   ),
756
 
   'Truncate multiple strings longer than whole line'
 
756
   "Don't truncate multiple strings longer than whole line"
757
757
);
758
758
 
759
759
# #############################################################################
881
881
   "IPs not shortened with more"
882
882
);
883
883
 
884
 
# Test show_all.
885
 
@ARGV = qw(--show-all host);
886
 
$o->get_opts();
887
 
$qrf = new QueryReportFormatter(
888
 
   OptionParser    => $o,
889
 
   QueryRewriter   => $qr,
890
 
   QueryParser     => $qp,
891
 
   Quoter          => $q, 
892
 
   ExplainAnalyzer => $ex,
893
 
);
894
884
$result = $qrf->event_report(
895
885
   ea       => $ea,
896
886
   select   => [ qw(Query_time host) ],