mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-17 17:27:57 +00:00
Merged simplify-pqd
This commit is contained in:
@@ -9,7 +9,7 @@ BEGIN {
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More tests => 82;
|
||||
use Test::More;
|
||||
|
||||
use QueryRewriter;
|
||||
use EventAggregator;
|
||||
@@ -431,7 +431,7 @@ foreach my $event (@$events) {
|
||||
is_deeply( $ea->results, $result, 'user aggregation' );
|
||||
|
||||
is($ea->type_for('Query_time'), 'num', 'Query_time is numeric');
|
||||
$ea->calculate_statistical_metrics(apdex_t => 1);
|
||||
$ea->calculate_statistical_metrics();
|
||||
is_deeply(
|
||||
$ea->metrics(
|
||||
where => 'bob',
|
||||
@@ -446,8 +446,6 @@ is_deeply(
|
||||
median => '0.000682',
|
||||
stddev => 0,
|
||||
pct_95 => '0.000682',
|
||||
apdex_t => 1,
|
||||
apdex => '1.00',
|
||||
},
|
||||
'Got simple hash of metrics from metrics()',
|
||||
);
|
||||
@@ -466,8 +464,6 @@ is_deeply(
|
||||
median => 0,
|
||||
stddev => 0,
|
||||
pct_95 => 0,
|
||||
apdex_t => undef,
|
||||
apdex => undef,
|
||||
},
|
||||
'It does not crash on metrics()',
|
||||
);
|
||||
@@ -1816,59 +1812,6 @@ is_deeply(
|
||||
"Merge results"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Apdex
|
||||
# #############################################################################
|
||||
|
||||
my $samples = {
|
||||
280 => 10, # 0.81623354758492 satisfy
|
||||
281 => 10, # 0.85704522496417 satisfy
|
||||
282 => 10, # 0.89989748621238 satisfy
|
||||
283 => 50, # 0.94489236052300 satisfy
|
||||
284 => 50, # 0.99213697854915 satisfy
|
||||
285 => 10, # 1.04174382747661 tolerate
|
||||
290 => 10, # 1.32955843985657 tolerate
|
||||
313 => 1, # 4.08377033290049 frustrated
|
||||
};
|
||||
my $apdex = $ea->calculate_apdex(
|
||||
t => 1,
|
||||
samples => $samples,
|
||||
);
|
||||
|
||||
is(
|
||||
$apdex,
|
||||
'0.93',
|
||||
"Apdex score"
|
||||
);
|
||||
|
||||
$samples = {
|
||||
0 => 150,
|
||||
};
|
||||
$apdex = $ea->calculate_apdex(
|
||||
t => 1,
|
||||
samples => $samples,
|
||||
);
|
||||
|
||||
is(
|
||||
$apdex,
|
||||
'1.00',
|
||||
"Apdex score 1.00"
|
||||
);
|
||||
|
||||
$samples = {
|
||||
400 => 150,
|
||||
};
|
||||
$apdex = $ea->calculate_apdex(
|
||||
t => 1,
|
||||
samples => $samples,
|
||||
);
|
||||
|
||||
is(
|
||||
$apdex,
|
||||
'0.00',
|
||||
"Apdex score 0.00"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Special-case attribs called *_crc for mqd --variations.
|
||||
# #############################################################################
|
||||
@@ -1953,4 +1896,5 @@ like(
|
||||
qr/Complete test coverage/,
|
||||
'_d() works'
|
||||
);
|
||||
done_testing;
|
||||
exit;
|
||||
|
@@ -425,149 +425,6 @@ is_deeply(
|
||||
],
|
||||
'Got saved usage for 0xdeadbeef');
|
||||
|
||||
# #############################################################################
|
||||
# Issue 1141: Add "spark charts" to mk-query-digest profile
|
||||
# #############################################################################
|
||||
is(
|
||||
$exa->sparkline(explain =>
|
||||
[
|
||||
{ id => 1,
|
||||
select_type => 'PRIMARY',
|
||||
table => 'foo',
|
||||
type => 'eq_ref',
|
||||
possible_keys => ['idx'],
|
||||
key => ['idx'],
|
||||
key_len => [10],
|
||||
ref => [],
|
||||
rows => 100,
|
||||
Extra => {
|
||||
'Using index' => 1,
|
||||
'Using where' => 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
),
|
||||
"E",
|
||||
"sparkline: basic 1 table eq_ref"
|
||||
);
|
||||
|
||||
is(
|
||||
$exa->sparkline(explain =>
|
||||
[
|
||||
{ id => 1,
|
||||
select_type => 'PRIMARY',
|
||||
table => 'foo',
|
||||
type => 'eq_ref',
|
||||
possible_keys => ['idx'],
|
||||
key => ['idx'],
|
||||
key_len => [10],
|
||||
ref => [],
|
||||
rows => 100,
|
||||
Extra => {
|
||||
'Using index' => 1,
|
||||
'Using where' => 1,
|
||||
'Using filesort' => 1,
|
||||
},
|
||||
},
|
||||
{ id => 2,
|
||||
select_type => 'PRIMARY',
|
||||
table => 'bar',
|
||||
type => 'ref',
|
||||
possible_keys => ['idx'],
|
||||
key => ['idx'],
|
||||
key_len => [10],
|
||||
ref => ['foo.col'],
|
||||
rows => 100,
|
||||
Extra => {
|
||||
},
|
||||
},
|
||||
],
|
||||
),
|
||||
"F>Er",
|
||||
"sparkline: 2 table with filesort at start"
|
||||
);
|
||||
|
||||
is(
|
||||
$exa->sparkline(explain =>
|
||||
[
|
||||
{ id => 1,
|
||||
select_type => 'PRIMARY',
|
||||
table => 'foo',
|
||||
type => 'range',
|
||||
possible_keys => ['idx'],
|
||||
key => ['idx'],
|
||||
key_len => [10],
|
||||
ref => [],
|
||||
rows => 100,
|
||||
Extra => {
|
||||
},
|
||||
},
|
||||
{ id => 2,
|
||||
select_type => 'PRIMARY',
|
||||
table => 'bar',
|
||||
type => 'ref',
|
||||
possible_keys => ['idx'],
|
||||
key => ['idx'],
|
||||
key_len => [10],
|
||||
ref => ['foo.col'],
|
||||
rows => 100,
|
||||
Extra => {
|
||||
'Using temporary' => 1,
|
||||
'Using filesort' => 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
),
|
||||
"nr>TF",
|
||||
"sparkline: 2 table with temp and filesort at end"
|
||||
);
|
||||
|
||||
is(
|
||||
$exa->sparkline(explain =>
|
||||
[
|
||||
{ id => 1,
|
||||
select_type => 'PRIMARY',
|
||||
table => undef,
|
||||
type => undef,
|
||||
possible_keys => [],
|
||||
key => [],
|
||||
key_len => [],
|
||||
ref => [],
|
||||
rows => undef,
|
||||
Extra => {
|
||||
'No tables used' => 1,
|
||||
},
|
||||
},
|
||||
{ id => 1,
|
||||
select_type => 'UNION',
|
||||
table => 'a',
|
||||
type => 'index',
|
||||
possible_keys => [],
|
||||
key => ['PRIMARY'],
|
||||
key_len => [2],
|
||||
ref => [],
|
||||
rows => 200,
|
||||
Extra => {
|
||||
'Using index' => 1,
|
||||
},
|
||||
},
|
||||
{ id => undef,
|
||||
select_type => 'UNION RESULT',
|
||||
table => '<union1,2>',
|
||||
type => 'ALL',
|
||||
possible_keys => [],
|
||||
key => [],
|
||||
key_len => [],
|
||||
ref => [],
|
||||
rows => undef,
|
||||
Extra => {},
|
||||
},
|
||||
],
|
||||
),
|
||||
"-Ia",
|
||||
"sparkline: 3 tables, using index"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
@@ -261,7 +261,7 @@ $pipeline->add(
|
||||
);
|
||||
|
||||
$output = output(
|
||||
sub { $pipeline->execute(%args) },
|
||||
sub {$pipeline->execute(%args); },
|
||||
stderr => 1,
|
||||
);
|
||||
|
||||
|
@@ -43,7 +43,6 @@ my $o = new OptionParser(description=>'qrf');
|
||||
my $ex = new ExplainAnalyzer(QueryRewriter => $qr, QueryParser => $qp);
|
||||
|
||||
$o->get_specs("$trunk/bin/pt-query-digest");
|
||||
|
||||
my $qrf = new QueryReportFormatter(
|
||||
OptionParser => $o,
|
||||
QueryRewriter => $qr,
|
||||
@@ -885,6 +884,13 @@ ok(
|
||||
# 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) ],
|
||||
@@ -971,7 +977,13 @@ $ea->calculate_statistical_metrics(apdex_t=>1);
|
||||
# Reset opts in case anything above left something set.
|
||||
@ARGV = qw();
|
||||
$o->get_opts();
|
||||
|
||||
$qrf = new QueryReportFormatter(
|
||||
OptionParser => $o,
|
||||
QueryRewriter => $qr,
|
||||
QueryParser => $qp,
|
||||
Quoter => $q,
|
||||
ExplainAnalyzer => $ex,
|
||||
);
|
||||
# Normally, the report subs will make their own ReportFormatter but
|
||||
# that package isn't visible to QueryReportFormatter right now so we
|
||||
# make ReportFormatters and pass them in. Since ReporFormatters can't
|
||||
@@ -980,7 +992,7 @@ $o->get_opts();
|
||||
# profile subreport. And the line width is 82 because that's the new
|
||||
# default to accommodate the EXPLAIN sparkline (issue 1141).
|
||||
my $report = new ReportFormatter(line_width=>82);
|
||||
$qrf->set_report_formatter(report=>'profile', formatter=>$report);
|
||||
$qrf->{formatter} = $report;
|
||||
ok(
|
||||
no_diff(
|
||||
sub { $qrf->print_reports(
|
||||
@@ -997,8 +1009,6 @@ ok(
|
||||
"print_reports(header, query_report, profile)"
|
||||
);
|
||||
|
||||
$report = new ReportFormatter(line_width=>82);
|
||||
$qrf->set_report_formatter(report=>'profile', formatter=>$report);
|
||||
ok(
|
||||
no_diff(
|
||||
sub { $qrf->print_reports(
|
||||
@@ -1051,11 +1061,6 @@ foreach my $event ( @$events ) {
|
||||
$ea->aggregate($event);
|
||||
}
|
||||
$ea->calculate_statistical_metrics();
|
||||
$report = new ReportFormatter(
|
||||
line_width => 82,
|
||||
extend_right => 1,
|
||||
);
|
||||
$qrf->set_report_formatter(report=>'prepared', formatter=>$report);
|
||||
ok(
|
||||
no_diff(
|
||||
sub {
|
||||
@@ -1094,11 +1099,6 @@ foreach my $event ( @$events ) {
|
||||
$ea->aggregate($event);
|
||||
}
|
||||
$ea->calculate_statistical_metrics();
|
||||
$report = new ReportFormatter(
|
||||
line_width => 82,
|
||||
extend_right => 1,
|
||||
);
|
||||
$qrf->set_report_formatter(report=>'profile', formatter=>$report);
|
||||
ok(
|
||||
no_diff(
|
||||
sub {
|
||||
@@ -1130,7 +1130,13 @@ SKIP: {
|
||||
|
||||
@ARGV = qw(--explain F=/tmp/12345/my.sandbox.cnf);
|
||||
$o->get_opts();
|
||||
|
||||
$qrf = new QueryReportFormatter(
|
||||
OptionParser => $o,
|
||||
QueryRewriter => $qr,
|
||||
QueryParser => $qp,
|
||||
Quoter => $q,
|
||||
ExplainAnalyzer => $ex,
|
||||
);
|
||||
my $qrf = new QueryReportFormatter(
|
||||
OptionParser => $o,
|
||||
QueryRewriter => $qr,
|
||||
@@ -1151,70 +1157,6 @@ SKIP: {
|
||||
"explain_report()"
|
||||
);
|
||||
|
||||
my $arg = "select t1.i from t as t1 join t as t2 where t1.i < t2.i and t1.v is not null order by t1.i";
|
||||
my $fingerprint = $qr->fingerprint($arg);
|
||||
|
||||
$events = [
|
||||
{
|
||||
Query_time => '0.000286',
|
||||
arg => $arg,
|
||||
fingerprint => $fingerprint,
|
||||
bytes => length $arg,
|
||||
cmd => 'Query',
|
||||
db => 'qrf',
|
||||
pos_in_log => 0,
|
||||
ts => '091208 09:23:49.637394',
|
||||
},
|
||||
];
|
||||
$ea = new EventAggregator(
|
||||
groupby => 'fingerprint',
|
||||
worst => 'Query_time',
|
||||
);
|
||||
foreach my $event ( @$events ) {
|
||||
$ea->aggregate($event);
|
||||
}
|
||||
$ea->calculate_statistical_metrics();
|
||||
|
||||
# Make sure that explain_sparkline() does USE db like explain_report()
|
||||
# does because by mqd defaults expalin_sparline() is called by profile()
|
||||
# so if it doesn't USE db then the EXPLAIN will fail. Here we reset
|
||||
# the db to something else because we already called explain_report()
|
||||
# above which did USE qrf.
|
||||
#
|
||||
# 5.6 really is that different: ia vs. TF>aI. It's smarter.
|
||||
$dbh->do("USE mysql");
|
||||
my $explain_sparkline = $qrf->explain_sparkline($arg, 'qrf');
|
||||
is(
|
||||
$explain_sparkline,
|
||||
$sandbox_version eq '5.6' ? "ia" : "TF>aI",
|
||||
"explain_sparkling() uses db"
|
||||
);
|
||||
|
||||
$report = new ReportFormatter(
|
||||
line_width => 82,
|
||||
extend_right => 1,
|
||||
);
|
||||
$qrf->set_report_formatter(report=>'profile', formatter=>$report);
|
||||
$dbh->do("USE mysql"); # same reason as above ^; force use db from event
|
||||
ok(
|
||||
no_diff(
|
||||
sub {
|
||||
$qrf->print_reports(
|
||||
reports => ['profile', 'query_report'],
|
||||
ea => $ea,
|
||||
worst => [ [$fingerprint, 'top', 1], ],
|
||||
other => [ [$fingerprint, 'misc', 2], ],
|
||||
orderby => 'Query_time',
|
||||
groupby => 'fingerprint',
|
||||
);
|
||||
},
|
||||
( $sandbox_version eq '5.6' ? "t/lib/samples/QueryReportFormatter/report032.txt"
|
||||
: $sandbox_version ge '5.1' ? "t/lib/samples/QueryReportFormatter/report027.txt"
|
||||
: "t/lib/samples/QueryReportFormatter/report029.txt"),
|
||||
),
|
||||
"EXPLAIN sparkline (issue 1141)"
|
||||
);
|
||||
|
||||
$sb->wipe_clean($dbh);
|
||||
$dbh->disconnect();
|
||||
}
|
||||
@@ -1265,7 +1207,6 @@ foreach my $event ( @$events ) {
|
||||
$ea->calculate_statistical_metrics();
|
||||
@ARGV = qw();
|
||||
$o->get_opts();
|
||||
$report = new ReportFormatter(line_width=>82);
|
||||
$qrf = new QueryReportFormatter(
|
||||
OptionParser => $o,
|
||||
QueryRewriter => $qr,
|
||||
@@ -1273,7 +1214,6 @@ $qrf = new QueryReportFormatter(
|
||||
Quoter => $q,
|
||||
ExplainAnalyzer => $ex,
|
||||
);
|
||||
$qrf->set_report_formatter(report=>'profile', formatter=>$report);
|
||||
my $output = output(
|
||||
sub { $qrf->print_reports(
|
||||
reports => [qw(rusage date files header query_report profile)],
|
||||
@@ -1337,11 +1277,6 @@ foreach my $event ( @$events ) {
|
||||
$ea->aggregate($event);
|
||||
}
|
||||
$ea->calculate_statistical_metrics();
|
||||
$report = new ReportFormatter(
|
||||
line_width => 82,
|
||||
extend_right => 1,
|
||||
);
|
||||
$qrf->set_report_formatter(report=>'profile', formatter=>$report);
|
||||
ok(
|
||||
no_diff(
|
||||
sub {
|
||||
@@ -1360,181 +1295,6 @@ ok(
|
||||
"Variance-to-mean ration (issue 1124)"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Issue 1141: Add "spark charts" to mk-query-digest profile
|
||||
# #############################################################################
|
||||
sub proc_events {
|
||||
my ( %args ) = @_;
|
||||
my ($arg, $attrib, $vals) = @args{qw(arg attrib vals)};
|
||||
|
||||
my $bytes = length $arg;
|
||||
my $fingerprint = $qr->fingerprint($arg);
|
||||
|
||||
$events = [];
|
||||
foreach my $val ( @$vals ) {
|
||||
push @$events, {
|
||||
bytes => $bytes,
|
||||
arg => $arg,
|
||||
fingerprint => $fingerprint,
|
||||
$attrib => $val,
|
||||
}
|
||||
}
|
||||
|
||||
$ea = new EventAggregator(
|
||||
groupby => 'fingerprint',
|
||||
worst => 'Query_time',
|
||||
);
|
||||
foreach my $event (@$events) {
|
||||
$ea->aggregate($event);
|
||||
}
|
||||
$ea->calculate_statistical_metrics(apdex_t=>1);
|
||||
|
||||
# Seeing the full chart helps determine what the
|
||||
# sparkline should look like.
|
||||
if ( $args{chart} ) {
|
||||
$result = $qrf->chart_distro(
|
||||
ea => $ea,
|
||||
item => 'select c from t',
|
||||
attrib => 'Query_time',
|
||||
);
|
||||
print $result;
|
||||
}
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
# Test sparklines in isolation.
|
||||
proc_events(
|
||||
arg => 'select c from t',
|
||||
attrib => 'Query_time',
|
||||
vals => [qw(0 0 0)],
|
||||
);
|
||||
$result = $qrf->distro_sparkline(
|
||||
ea => $ea,
|
||||
item => 'select c from t',
|
||||
attrib => 'Query_time',
|
||||
);
|
||||
is(
|
||||
$result,
|
||||
" ",
|
||||
"Sparkchart line - all zeros"
|
||||
);
|
||||
|
||||
# 1us
|
||||
# 10us
|
||||
# 100us ################################################
|
||||
# 1ms ################################
|
||||
# 10ms ################################
|
||||
# 100ms ################################################################
|
||||
# 1s ################
|
||||
# 10s+
|
||||
proc_events(
|
||||
arg => 'select c from t',
|
||||
attrib => 'Query_time',
|
||||
vals => [qw(0.100000 0.500000 0.000600 0.008000 0.990000 1.000000 0.400000 0.003000 0.000200 0.000100 0.010000 0.020000)],
|
||||
);
|
||||
$result = $qrf->distro_sparkline(
|
||||
ea => $ea,
|
||||
item => 'select c from t',
|
||||
attrib => 'Query_time',
|
||||
);
|
||||
is(
|
||||
$result,
|
||||
" -..^_ ",
|
||||
"Sparkchart line 1"
|
||||
);
|
||||
|
||||
# 1us
|
||||
# 10us
|
||||
# 100us
|
||||
# 1ms
|
||||
# 10ms ################################
|
||||
# 100ms ################################################################
|
||||
# 1s ########
|
||||
# 10s+
|
||||
proc_events(
|
||||
arg => 'select c from t',
|
||||
attrib => 'Query_time',
|
||||
vals => [qw(0.01 0.03 0.08 0.09 0.3 0.5 0.5 0.6 0.7 0.5 0.5 0.9 1.0)],
|
||||
);
|
||||
$result = $qrf->distro_sparkline(
|
||||
ea => $ea,
|
||||
item => 'select c from t',
|
||||
attrib => 'Query_time',
|
||||
);
|
||||
is(
|
||||
$result,
|
||||
" .^_ ",
|
||||
"Sparkchart line 2"
|
||||
);
|
||||
|
||||
# 1us ################################################################
|
||||
# 10us ################################################################
|
||||
# 100us ################################################################
|
||||
# 1ms ################################################################
|
||||
# 10ms ################################################################
|
||||
# 100ms ################################################################
|
||||
# 1s ################################################################
|
||||
# 10s+
|
||||
proc_events(
|
||||
arg => 'select c from t',
|
||||
attrib => 'Query_time',
|
||||
vals => [qw(0.000003 0.000030 0.000300 0.003000 0.030000 0.300000 3)],
|
||||
);
|
||||
$result = $qrf->distro_sparkline(
|
||||
ea => $ea,
|
||||
item => 'select c from t',
|
||||
attrib => 'Query_time',
|
||||
);
|
||||
is(
|
||||
$result,
|
||||
"^^^^^^^ ",
|
||||
"Sparkchart line - vals in all ranges except 10s+"
|
||||
);
|
||||
|
||||
|
||||
# 1us ################################################################
|
||||
# 10us ################################################################
|
||||
# 100us
|
||||
# 1ms
|
||||
# 10ms
|
||||
# 100ms
|
||||
# 1s ################################################################
|
||||
# 10s+ ################################################################
|
||||
proc_events(
|
||||
arg => 'select c from t',
|
||||
attrib => 'Query_time',
|
||||
vals => [qw(0.000003 0.000030 0.000003 0.000030 3 3 30 30)],
|
||||
);
|
||||
$result = $qrf->distro_sparkline(
|
||||
ea => $ea,
|
||||
item => 'select c from t',
|
||||
attrib => 'Query_time',
|
||||
);
|
||||
is(
|
||||
$result,
|
||||
"^^ ^^",
|
||||
"Sparkchart line - twin peaks"
|
||||
);
|
||||
|
||||
# Test that that ^ sparkchart appears in the event header properly.
|
||||
$result = $qrf->event_report(
|
||||
ea => $ea,
|
||||
select => [ qw(Query_time) ],
|
||||
item => 'select c from t',
|
||||
rank => 1,
|
||||
orderby => 'Query_time',
|
||||
reason => 'top',
|
||||
);
|
||||
ok(
|
||||
no_diff(
|
||||
$result,
|
||||
"t/lib/samples/QueryReportFormatter/report028.txt",
|
||||
cmd_output => 1,
|
||||
),
|
||||
'Sparkchart in event header'
|
||||
);
|
||||
|
||||
# ############################################################################
|
||||
# Bug 887688: Prepared statements crash pt-query-digest
|
||||
# ############################################################################
|
||||
@@ -1565,11 +1325,6 @@ foreach my $event ( @$events ) {
|
||||
$ea->aggregate($event);
|
||||
}
|
||||
$ea->calculate_statistical_metrics();
|
||||
$report = new ReportFormatter(
|
||||
line_width => 82,
|
||||
extend_right => 1,
|
||||
);
|
||||
$qrf->set_report_formatter(report=>'prepared', formatter=>$report);
|
||||
ok(
|
||||
no_diff(
|
||||
sub {
|
||||
|
@@ -161,7 +161,6 @@ my $hist_struct = $tp->parse(
|
||||
|
||||
$qv->set_history_options(
|
||||
table => 'test.query_review_history',
|
||||
dbh => $dbh,
|
||||
quoter => $q,
|
||||
tbl_struct => $hist_struct,
|
||||
col_pat => qr/^(.*?)_($pat)$/,
|
||||
@@ -257,7 +256,6 @@ $hist_struct = $tp->parse(
|
||||
$tp->get_create_table($dbh, 'test', 'query_review_history'));
|
||||
$qv->set_history_options(
|
||||
table => 'test.query_review_history',
|
||||
dbh => $dbh,
|
||||
quoter => $q,
|
||||
tbl_struct => $hist_struct,
|
||||
col_pat => qr/^(.*?)_($pat)$/,
|
||||
|
@@ -88,7 +88,7 @@ is(
|
||||
# Basic report.
|
||||
# #############################################################################
|
||||
$rf = new ReportFormatter();
|
||||
$rf->set_title('Checksum differences');
|
||||
$rf->title('Checksum differences');
|
||||
$rf->set_columns(
|
||||
{
|
||||
name => 'Query ID',
|
||||
@@ -216,7 +216,7 @@ is(
|
||||
# Respect line width.
|
||||
# #############################################################################
|
||||
$rf = new ReportFormatter();
|
||||
$rf->set_title('Respect line width');
|
||||
$rf->title('Respect line width');
|
||||
$rf->set_columns(
|
||||
{ name => 'col1' },
|
||||
{ name => 'col2' },
|
||||
@@ -248,7 +248,7 @@ is(
|
||||
# extend_right
|
||||
# #############################################################################
|
||||
$rf = new ReportFormatter(extend_right=>1);
|
||||
$rf->set_title('extend_right');
|
||||
$rf->title('extend_right');
|
||||
$rf->set_columns(
|
||||
{ name => 'col1' },
|
||||
{ name => 'col2' },
|
||||
@@ -280,7 +280,7 @@ is(
|
||||
# Relvative column widths.
|
||||
# #############################################################################
|
||||
$rf = new ReportFormatter();
|
||||
$rf->set_title('Relative col widths');
|
||||
$rf->title('Relative col widths');
|
||||
$rf->set_columns(
|
||||
{ name => 'col1', width_pct=>'20', },
|
||||
{ name => 'col2', width_pct=>'40', },
|
||||
@@ -309,7 +309,7 @@ is(
|
||||
);
|
||||
|
||||
$rf = new ReportFormatter();
|
||||
$rf->set_title('Relative col widths');
|
||||
$rf->title('Relative col widths');
|
||||
$rf->set_columns(
|
||||
{ name => 'col1', width_pct=>'20', },
|
||||
{ name => 'col2', width_pct=>'40', },
|
||||
@@ -344,7 +344,7 @@ is(
|
||||
);
|
||||
|
||||
$rf = new ReportFormatter();
|
||||
$rf->set_title('Relative col widths');
|
||||
$rf->title('Relative col widths');
|
||||
$rf->set_columns(
|
||||
{ name => 'col1', width =>'25', },
|
||||
{ name => 'col2', width_pct=>'33', },
|
||||
@@ -380,7 +380,7 @@ is(
|
||||
|
||||
|
||||
$rf = new ReportFormatter();
|
||||
$rf->set_title('Short cols');
|
||||
$rf->title('Short cols');
|
||||
$rf->set_columns(
|
||||
{ name => 'I am column1', },
|
||||
{ name => 'I am column2', },
|
||||
@@ -403,7 +403,7 @@ is(
|
||||
);
|
||||
|
||||
$rf = new ReportFormatter();
|
||||
$rf->set_title('Short cols');
|
||||
$rf->title('Short cols');
|
||||
$rf->set_columns(
|
||||
{ name => 'I am column1', },
|
||||
{ name => 'I am column2', },
|
||||
@@ -422,7 +422,7 @@ is(
|
||||
);
|
||||
|
||||
$rf = new ReportFormatter();
|
||||
$rf->set_title('Short cols');
|
||||
$rf->title('Short cols');
|
||||
$rf->set_columns(
|
||||
{ name => 'I am column1', },
|
||||
{ name => 'I am column2', },
|
||||
|
@@ -7,8 +7,7 @@
|
||||
# Lock time 1ms 1ms 1ms 1ms 1ms 0 1ms
|
||||
|
||||
# Query 1: 0 QPS, 0x concurrency, ID 0x5796997451B1FA1D at byte 123 ______
|
||||
# Scores: Apdex = 1.00 [1.0]*, V/M = 0.00
|
||||
# Query_time sparkline: | ^ |
|
||||
# Scores: V/M = 0.00
|
||||
# Time range: all events occurred at 2007-10-15 21:43:52
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
@@ -35,6 +34,6 @@
|
||||
select col from tbl where id=42\G
|
||||
|
||||
# Profile
|
||||
# Rank Query ID Response time Calls R/Call Apdx V/M Item
|
||||
# ==== ================== ============= ===== ====== ==== ===== ==========
|
||||
# 1 0x5796997451B1FA1D 1.0007 100.0% 1 1.0007 1.00 0.00 SELECT tbl
|
||||
# Rank Query ID Response time Calls R/Call V/M Item
|
||||
# ==== ================== ============= ===== ====== ===== ==========
|
||||
# 1 0x5796997451B1FA1D 1.0007 100.0% 1 1.0007 0.00 SELECT tbl
|
||||
|
@@ -1,7 +1,6 @@
|
||||
|
||||
# Query 1: 0 QPS, 0x concurrency, ID 0x3F79759E7FA2F117 at byte 1106 _____
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.00
|
||||
# Query_time sparkline: | ^ |
|
||||
# Scores: V/M = 0.00
|
||||
# Time range: all events occurred at 2009-12-08 09:23:49.637892
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
@@ -31,8 +30,7 @@ EXECUTE SELECT i FROM d.t WHERE i="3"\G
|
||||
SELECT i FROM d.t WHERE i="3"\G
|
||||
|
||||
# Query 2: 0 QPS, 0x concurrency, ID 0xAA8E9FA785927259 at byte 0 ________
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.00
|
||||
# Query_time sparkline: | ^ |
|
||||
# Scores: V/M = 0.00
|
||||
# Time range: all events occurred at 2009-12-08 09:23:49.637394
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
|
@@ -1,12 +1,11 @@
|
||||
|
||||
# Profile
|
||||
# Rank Query ID Response time Calls R/Call Apdx V/M Item
|
||||
# ==== ================== ============= ===== ====== ==== ===== ==========
|
||||
# 1 0x5796997451B1FA1D 1.0007 100.0% 1 1.0007 1.00 0.00 SELECT tbl
|
||||
# Rank Query ID Response time Calls R/Call V/M Item
|
||||
# ==== ================== ============= ===== ====== ===== ==========
|
||||
# 1 0x5796997451B1FA1D 1.0007 100.0% 1 1.0007 0.00 SELECT tbl
|
||||
|
||||
# Query 1: 0 QPS, 0x concurrency, ID 0x5796997451B1FA1D at byte 123 ______
|
||||
# Scores: Apdex = 1.00 [1.0]*, V/M = 0.00
|
||||
# Query_time sparkline: | ^ |
|
||||
# Scores: V/M = 0.00
|
||||
# Time range: all events occurred at 2007-10-15 21:43:52
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
|
@@ -1,6 +1,6 @@
|
||||
|
||||
# Profile
|
||||
# Rank Query ID Response time Calls R/Call Apdx V/M Item
|
||||
# ==== ================== ============= ===== ====== ==== ===== ==========
|
||||
# 1 0xAECF4CA2310AC9E2 1.0303 97.1% 1 1.0303 NS 0.00 UPDATE foo
|
||||
# MISC 0xMISC 0.0306 2.9% 2 0.0153 NS 0.0 <2 ITEMS>
|
||||
# Rank Query ID Response time Calls R/Call V/M Item
|
||||
# ==== ================== ============= ===== ====== ===== ==========
|
||||
# 1 0xAECF4CA2310AC9E2 1.0303 97.1% 1 1.0303 0.00 UPDATE foo
|
||||
# MISC 0xMISC 0.0306 2.9% 2 0.0153 0.0 <2 ITEMS>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
|
||||
# Profile
|
||||
# Rank Query ID Response time Calls R/Call Apdx V/M Item
|
||||
# ==== ================== ============== ===== ====== ==== ===== ========
|
||||
# 1 0xCB5621E548E5497F 17.5000 100.0% 4 4.3750 NS 2.23 SELECT t
|
||||
# Rank Query ID Response time Calls R/Call V/M Item
|
||||
# ==== ================== ============== ===== ====== ===== ========
|
||||
# 1 0xCB5621E548E5497F 17.5000 100.0% 4 4.3750 2.23 SELECT t
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Query 1: 2 QPS, 9.00x concurrency, ID 0x82860EDA9A88FCC5 at byte 1 _____
|
||||
# This item is included in the report because it matches --limit.
|
||||
# Scores: Apdex = 0.50 [1.0]*, V/M = 5.44
|
||||
# Scores: V/M = 5.44
|
||||
# Time range: 2007-10-15 21:43:52 to 21:43:53
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Query 1: 0 QPS, 0x concurrency, ID 0x5D51E5F01B88B79E at byte 0 ________
|
||||
# This item is included in the report because it matches --limit.
|
||||
# Scores: Apdex = 1.00 [1.0]*, V/M = 0.00
|
||||
# Scores: V/M = 0.00
|
||||
# Time range: all events occurred at 2009-04-12 11:00:13.118191
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Query 1: 0 QPS, 0x concurrency, ID 0x82860EDA9A88FCC5 at byte 0 ________
|
||||
# This item is included in the report because it matches --limit.
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.00
|
||||
# Scores: V/M = 0.00
|
||||
# Time range: all events occurred at 2007-10-15 21:43:52
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Query 1: 0.67 QPS, 1x concurrency, ID 0x82860EDA9A88FCC5 at byte 0 _____
|
||||
# This item is included in the report because it matches --limit.
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.33
|
||||
# Scores: V/M = 0.33
|
||||
# Time range: 2007-10-15 21:43:52 to 21:43:55
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Query 1: 1 QPS, 2x concurrency, ID 0x82860EDA9A88FCC5 at byte 0 ________
|
||||
# This item is included in the report because it matches --limit.
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.30
|
||||
# Scores: V/M = 0.30
|
||||
# Time range: 2007-10-15 21:43:52 to 21:43:55
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# Item 1: 0 QPS, 0x concurrency, ID 0xEDEF654FCCC4A4D8 at byte 0 _________
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.00
|
||||
# Scores: V/M = 0.00
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
# Count 100 2
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# Item 1: 0 QPS, 0x concurrency, ID 0xEDEF654FCCC4A4D8 at byte 0 _________
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.00
|
||||
# Scores: V/M = 0.00
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
# Count 100 3
|
||||
|
@@ -1,6 +1,5 @@
|
||||
# Item 1: 0 QPS, 0x concurrency, ID 0xEDEF654FCCC4A4D8 at byte 0 _________
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.00
|
||||
# Query_time sparkline: | ^ |
|
||||
# Scores: V/M = 0.00
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
# Count 100 3
|
||||
|
@@ -1,6 +1,5 @@
|
||||
# Item 1: 0 QPS, 0x concurrency, ID 0xEDEF654FCCC4A4D8 at byte 0 _________
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.00
|
||||
# Query_time sparkline: | ^ |
|
||||
# Scores: V/M = 0.00
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
# Count 100 1
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# Query 0: 0 QPS, 0x concurrency, ID 0x82860EDA9A88FCC5 at byte 0 ________
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.00
|
||||
# Scores: V/M = 0.00
|
||||
# Time range: all events occurred at 2007-10-15 21:43:52
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
|
@@ -1,58 +0,0 @@
|
||||
|
||||
# Profile
|
||||
# Rank Query ID Response time Calls R/Call Apdx V/M EXPLAIN Item
|
||||
# ==== ================== ============= ===== ====== ==== ===== ======= =========
|
||||
# 1 0x46F81B022F1AD76B 0.0003 100.0% 1 0.0003 NS 0.00 TF>aI SELECT t
|
||||
# MISC 0xMISC 0.0003 100.0% 1 0.0003 NS 0.0 MISC <1 ITEMS>
|
||||
|
||||
# Query 1: 0 QPS, 0x concurrency, ID 0x46F81B022F1AD76B at byte 0 ________
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.00
|
||||
# EXPLAIN sparkline: TF>aI
|
||||
# Query_time sparkline: | ^ |
|
||||
# Time range: all events occurred at 2009-12-08 09:23:49.637394
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
# Count 100 1
|
||||
# Exec time 100 286us 286us 286us 286us 286us 0 286us
|
||||
# Query size 100 90 90 90 90 90 0 90
|
||||
# String:
|
||||
# cmd Query
|
||||
# Databases qrf
|
||||
# Query_time distribution
|
||||
# 1us
|
||||
# 10us
|
||||
# 100us ################################################################
|
||||
# 1ms
|
||||
# 10ms
|
||||
# 100ms
|
||||
# 1s
|
||||
# 10s+
|
||||
# Tables
|
||||
# SHOW TABLE STATUS FROM `qrf` LIKE 't'\G
|
||||
# SHOW CREATE TABLE `qrf`.`t`\G
|
||||
# EXPLAIN /*!50100 PARTITIONS*/
|
||||
select t1.i from t as t1 join t as t2 where t1.i < t2.i and t1.v is not null order by t1.i\G
|
||||
# *************************** 1. row ***************************
|
||||
# id: 1
|
||||
# select_type: SIMPLE
|
||||
# table: t1
|
||||
# partitions: NULL
|
||||
# type: ALL
|
||||
# possible_keys: PRIMARY
|
||||
# key: NULL
|
||||
# key_len: NULL
|
||||
# ref: NULL
|
||||
# rows: 4
|
||||
# Extra: Using where; Using temporary; Using filesort
|
||||
# *************************** 2. row ***************************
|
||||
# id: 1
|
||||
# select_type: SIMPLE
|
||||
# table: t2
|
||||
# partitions: NULL
|
||||
# type: index
|
||||
# possible_keys: PRIMARY
|
||||
# key: PRIMARY
|
||||
# key_len: 4
|
||||
# ref: NULL
|
||||
# rows: 4
|
||||
# Extra: Using where; Using index; Using join buffer
|
@@ -1,6 +1,6 @@
|
||||
# Query 1: 0 QPS, 0x concurrency, ID 0xFDE00DF974C61E9F at byte 0 ________
|
||||
# This item is included in the report because it matches --limit.
|
||||
# Scores: Apdex = 0.62 [1.0]*, V/M = 17.71
|
||||
# Scores: V/M = 17.71
|
||||
# Query_time sparkline: |^^ ^^|
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
|
@@ -1,56 +0,0 @@
|
||||
|
||||
# Profile
|
||||
# Rank Query ID Response time Calls R/Call Apdx V/M EXPLAIN Item
|
||||
# ==== ================== ============= ===== ====== ==== ===== ======= =========
|
||||
# 1 0x46F81B022F1AD76B 0.0003 100.0% 1 0.0003 NS 0.00 TF>aI SELECT t
|
||||
# MISC 0xMISC 0.0003 100.0% 1 0.0003 NS 0.0 MISC <1 ITEMS>
|
||||
|
||||
# Query 1: 0 QPS, 0x concurrency, ID 0x46F81B022F1AD76B at byte 0 ________
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.00
|
||||
# EXPLAIN sparkline: TF>aI
|
||||
# Query_time sparkline: | ^ |
|
||||
# Time range: all events occurred at 2009-12-08 09:23:49.637394
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
# Count 100 1
|
||||
# Exec time 100 286us 286us 286us 286us 286us 0 286us
|
||||
# Query size 100 90 90 90 90 90 0 90
|
||||
# String:
|
||||
# cmd Query
|
||||
# Databases qrf
|
||||
# Query_time distribution
|
||||
# 1us
|
||||
# 10us
|
||||
# 100us ################################################################
|
||||
# 1ms
|
||||
# 10ms
|
||||
# 100ms
|
||||
# 1s
|
||||
# 10s+
|
||||
# Tables
|
||||
# SHOW TABLE STATUS FROM `qrf` LIKE 't'\G
|
||||
# SHOW CREATE TABLE `qrf`.`t`\G
|
||||
# EXPLAIN /*!50100 PARTITIONS*/
|
||||
select t1.i from t as t1 join t as t2 where t1.i < t2.i and t1.v is not null order by t1.i\G
|
||||
# *************************** 1. row ***************************
|
||||
# id: 1
|
||||
# select_type: SIMPLE
|
||||
# table: t1
|
||||
# type: ALL
|
||||
# possible_keys: PRIMARY
|
||||
# key: NULL
|
||||
# key_len: NULL
|
||||
# ref: NULL
|
||||
# rows: 4
|
||||
# Extra: Using where; Using temporary; Using filesort
|
||||
# *************************** 2. row ***************************
|
||||
# id: 1
|
||||
# select_type: SIMPLE
|
||||
# table: t2
|
||||
# type: index
|
||||
# possible_keys: PRIMARY
|
||||
# key: PRIMARY
|
||||
# key_len: 4
|
||||
# ref: NULL
|
||||
# rows: 4
|
||||
# Extra: Using where; Using index
|
@@ -1,58 +0,0 @@
|
||||
|
||||
# Profile
|
||||
# Rank Query ID Response time Calls R/Call Apdx V/M EXPLAIN Item
|
||||
# ==== ================== ============= ===== ====== ==== ===== ======= =========
|
||||
# 1 0x46F81B022F1AD76B 0.0003 100.0% 1 0.0003 NS 0.00 ia SELECT t
|
||||
# MISC 0xMISC 0.0003 100.0% 1 0.0003 NS 0.0 MISC <1 ITEMS>
|
||||
|
||||
# Query 1: 0 QPS, 0x concurrency, ID 0x46F81B022F1AD76B at byte 0 ________
|
||||
# Scores: Apdex = NS [0.0]*, V/M = 0.00
|
||||
# EXPLAIN sparkline: ia
|
||||
# Query_time sparkline: | ^ |
|
||||
# Time range: all events occurred at 2009-12-08 09:23:49.637394
|
||||
# Attribute pct total min max avg 95% stddev median
|
||||
# ============ === ======= ======= ======= ======= ======= ======= =======
|
||||
# Count 100 1
|
||||
# Exec time 100 286us 286us 286us 286us 286us 0 286us
|
||||
# Query size 100 90 90 90 90 90 0 90
|
||||
# String:
|
||||
# cmd Query
|
||||
# Databases qrf
|
||||
# Query_time distribution
|
||||
# 1us
|
||||
# 10us
|
||||
# 100us ################################################################
|
||||
# 1ms
|
||||
# 10ms
|
||||
# 100ms
|
||||
# 1s
|
||||
# 10s+
|
||||
# Tables
|
||||
# SHOW TABLE STATUS FROM `qrf` LIKE 't'\G
|
||||
# SHOW CREATE TABLE `qrf`.`t`\G
|
||||
# EXPLAIN /*!50100 PARTITIONS*/
|
||||
select t1.i from t as t1 join t as t2 where t1.i < t2.i and t1.v is not null order by t1.i\G
|
||||
# *************************** 1. row ***************************
|
||||
# id: 1
|
||||
# select_type: SIMPLE
|
||||
# table: t1
|
||||
# partitions: NULL
|
||||
# type: index
|
||||
# possible_keys: PRIMARY
|
||||
# key: PRIMARY
|
||||
# key_len: 4
|
||||
# ref: NULL
|
||||
# rows: 4
|
||||
# Extra: Using where
|
||||
# *************************** 2. row ***************************
|
||||
# id: 1
|
||||
# select_type: SIMPLE
|
||||
# table: t2
|
||||
# partitions: NULL
|
||||
# type: ALL
|
||||
# possible_keys: PRIMARY
|
||||
# key: NULL
|
||||
# key_len: NULL
|
||||
# ref: NULL
|
||||
# rows: 4
|
||||
# Extra: Range checked for each record (index map: 0x1)
|
Reference in New Issue
Block a user