pqd: Removed show-all, shorten, select & print-iterations

This commit is contained in:
Brian Fraser
2013-02-25 13:10:03 -03:00
parent 78cae8b91b
commit 1d9b013bab
14 changed files with 39 additions and 189 deletions

View File

@@ -1526,11 +1526,14 @@ ok(
'New event class has new attrib; default unroll_limit(issue 514)'
);
$ea = new EventAggregator(
groupby => 'arg',
worst => 'Query_time',
unroll_limit => 50,
);
$ea = do {
local $ENV{PT_QUERY_DIGEST_CHECK_ATTRIB_LIMIT} = 50;
new EventAggregator(
groupby => 'arg',
worst => 'Query_time'
);
};
parse_file('t/lib/samples/slowlogs/slow030.txt', $p, $ea);
ok(
!exists $ea->{unrolled_for}->{InnoDB_rec_lock_wait},

View File

@@ -464,7 +464,7 @@ ok(
# #############################################################################
# This test uses the $ea from the Bool pretty printer test above.
my $sorted = $qrf->sort_attribs($ea->get_attributes(), $ea);
my $sorted = $qrf->sort_attribs($ea);
is_deeply(
$sorted,
{
@@ -511,7 +511,7 @@ foreach my $event (@$events) {
}
$ea->calculate_statistical_metrics();
$sorted = $qrf->sort_attribs($ea->get_attributes(), $ea);
$sorted = $qrf->sort_attribs($ea);
is_deeply(
$sorted,
{
@@ -689,7 +689,7 @@ ok(
"t/lib/samples/QueryReportFormatter/report010.txt",
cmd_output => 1,
),
'Truncate one long string'
"Don't truncate one long string"
);
$ea->reset_aggregated_data();
@@ -721,7 +721,7 @@ ok(
"t/lib/samples/QueryReportFormatter/report011.txt",
cmd_output => 1,
),
'Truncate multiple long strings'
"Don't truncate multiple long strings"
);
$ea->reset_aggregated_data();
@@ -753,7 +753,7 @@ ok(
"t/lib/samples/QueryReportFormatter/report012.txt",
cmd_output => 1,
),
'Truncate multiple strings longer than whole line'
"Don't truncate multiple strings longer than whole line"
);
# #############################################################################
@@ -881,16 +881,6 @@ ok(
"IPs not shortened with more"
);
# Test show_all.
@ARGV = qw(--show-all host);
$o->get_opts();
$qrf = new QueryReportFormatter(
OptionParser => $o,
QueryRewriter => $qr,
QueryParser => $qp,
Quoter => $q,
ExplainAnalyzer => $ex,
);
$result = $qrf->event_report(
ea => $ea,
select => [ qw(Query_time host) ],

View File

@@ -7,4 +7,4 @@
# Count 100 3
# Exec time 100 6s 1s 3s 2s 3s 780ms 2s
# String:
# foo Hi. I'm a... (1/33%), Me too! I'... (1/33%)... 1 more
# foo Hi. I'm a... (1/33%), Me too! I'... (1/33%), Number 3 l... (1/33%)

View File

@@ -5,4 +5,4 @@
# Count 100 2
# Exec time 100 16s 8s 8s 8s 8s 0 8s
# String:
# Hosts 123.123.123.456 (1/50%)... 1 more
# Hosts 123.123.123.456 (1/50%), 123.123.123.789 (1/50%)

View File

@@ -5,4 +5,4 @@
# Count 100 3
# Exec time 100 24s 8s 8s 8s 8s 0 8s
# String:
# Hosts 123.123.123.456 (1/33%)... 2 more
# Hosts 123.123.123.456 (1/33%), 123.123.123.789 (1/33%), 123.123.123.999 (1/33%)

View File

@@ -1,44 +0,0 @@
# Query 1: 0 QPS, 0x concurrency, ID 0x7F7D57ACDD8A346E at byte 0 ________
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 50 1
# Exec time 50 2s 2s 2s 2s 2s 0 2s
# Query_time distribution
# 1us
# 10us
# 100us
# 1ms
# 10ms
# 100ms
# 1s ################################################################
# 10s+
# Tables
# SHOW TABLE STATUS FROM `test` LIKE 'n'\G
# SHOW CREATE TABLE `test`.`n`\G
# EXPLAIN /*!50100 PARTITIONS*/
select sleep(2) from n\G
# Query 2: 0 QPS, 0x concurrency, ID 0x3A99CC42AEDCCFCD at byte 359 ______
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 50 1
# Exec time 50 2s 2s 2s 2s 2s 0 2s
# Query_time distribution
# 1us
# 10us
# 100us
# 1ms
# 10ms
# 100ms
# 1s ################################################################
# 10s+
# Tables
# SHOW TABLE STATUS FROM `test` LIKE 'n'\G
# SHOW CREATE TABLE `test`.`n`\G
# EXPLAIN /*!50100 PARTITIONS*/
select sleep(2) from test.n\G

View File

@@ -1,30 +0,0 @@
# Query 1: 0 QPS, 0x concurrency, ID 0x7CE9953EA3A36141 at byte 417 ______
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: all events occurred at 2009-12-05 19:55:11
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 100 3
# Exec time 100 2ms 613us 613us 613us 613us 0 613us
# Lock time 99 321us 107us 107us 107us 107us 0 107us
# Rows sent 100 690 230 230 230 230 0 230
# Rows examine 100 690 230 230 230 230 0 230
# Rows affecte 0 0 0 0 0 0 0 0
# Rows read 100 690 230 230 230 230 0 230
# Query size 100 31 10 11 10.33 10.84 0.47 9.83
# String:
# Hosts 123.123.123.121 (1/33%)... 2 more
# Users chessguest
# Query_time distribution
# 1us
# 10us
# 100us ################################################################
# 1ms
# 10ms
# 100ms
# 1s
# 10s+
# EXPLAIN /*!50100 PARTITIONS*/
select foo
\G

View File

@@ -72,7 +72,7 @@ SELECT * FROM bar WHERE id=12\G
# Rows examine 0 0 0 0 0 0 0 0
# Query size 45 140 28 28 28 28 0 28
# String:
# arg crc 108 (1/20%), 306 (1/20%), 353 (1/20%)... 2 more
# arg crc 108 (1/20%), 306 (1/20%), 353 (1/20%), 558 (1/20%), 887 (1/20%)
# Query_time distribution
# 1us
# 10us ################################################################

View File

@@ -12,7 +12,7 @@
# Rows examine 0 0 0 0 0 0 0 0
# Query size 100 224 28 28 28 28 0 28
# String:
# InnoDB trxID 101 (1/12%), 102 (1/12%), 103 (1/12%)... 5 more
# InnoDB trxID 101 (1/12%), 102 (1/12%), 103 (1/12%), 104 (1/12%), 105 (1/12%), 106 (1/12%), A07 (1/12%), A08 (1/12%)
# Query_time distribution
# 1us
# 10us ################################################################

View File

@@ -56,7 +56,7 @@ select * from d.t where name="adam"\G
# Warning coun 0 0 0 0 0 0 0 0
# String:
# Hosts 127.0.0.1
# Statement id 2 (1/20%), 3 (1/20%), 4 (1/20%), 5 (1/20%)... 1 more
# Statement id 2 (1/20%), 3 (1/20%), 4 (1/20%), 5 (1/20%), 6 (1/20%)
# Query_time distribution
# 1us
# 10us

View File

@@ -63,14 +63,6 @@ ok(
'Timeline for slow002 with distill'
);
ok(
no_diff(
sub { pt_query_digest::main(@args, $sample.'slow001.txt', qw(--select Query_time)) },
"t/pt-query-digest/samples/slow001_select_report.txt"
),
'Analysis for slow001 --select'
);
ok(
no_diff(
sub { pt_query_digest::main(@args, $sample.'slow002.txt') },
@@ -307,23 +299,13 @@ is(
);
diag(`rm -rf /tmp/mqd-warnings.txt`);
# Issue 940
ok(
no_diff(
sub { pt_query_digest::main(@args, $sample.'slow042.txt',
qw(--report-format query_report)) },
"t/pt-query-digest/samples/slow042.txt",
),
'Analysis for slow042'
);
ok(
no_diff(
sub { pt_query_digest::main(@args, $sample.'slow042.txt',
qw(--report-format query_report --show-all host)) },
"t/pt-query-digest/samples/slow042-show-all-host.txt",
),
'Analysis for slow042 with --show-all hosts'
'Analysis for slow042 (previously the --show-all test)'
);
# #############################################################################
@@ -389,8 +371,7 @@ ok(
no_diff(
sub {
local $ENV{PT_QUERY_DIGEST_CHECK_ATTRIB_LIMIT} = 5;
pt_query_digest::main(@args, $sample.'slow054.txt',
qw(--check-attributes-limit 5))
pt_query_digest::main(@args, $sample.'slow054.txt')
},
"t/pt-query-digest/samples/slow054.txt",
),