Merge simplify-pqd r549.

This commit is contained in:
Daniel Nichter
2013-01-30 13:33:47 -07:00
15 changed files with 1036 additions and 223 deletions

View File

@@ -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)$/,

View File

@@ -34,11 +34,11 @@ else {
my $pid_file = "/tmp/pt-query-digest-test-issue_360.t.$PID";
# Need a clean query review table.
$sb->create_dbs($dbh, [qw(test)]);
$sb->create_dbs($dbh, [qw(test percona_schema)]);
# Run pt-query-digest in the background for 2s,
# saving queries to test.query_review.
diag(`$trunk/bin/pt-query-digest --processlist h=127.1,P=12345,u=msandbox,p=msandbox --interval 0.01 --create-review-table --review h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=query_review --daemonize --pid $pid_file --log /dev/null --run-time 2`);
diag(`$trunk/bin/pt-query-digest --processlist h=127.1,P=12345,u=msandbox,p=msandbox --interval 0.01 --create-review-table --review h=127.1,P=12345,u=msandbox,p=msandbox --review-table test.query_review --daemonize --pid $pid_file --log /dev/null --run-time 2`);
# Wait until its running.
PerconaTest::wait_for_files($pid_file);

View File

@@ -13,14 +13,33 @@ use Test::More;
use PerconaTest;
my $cmd = "$trunk/bin/pt-query-digest";
my $help = qx{$cmd --help};
my $output;
# #############################################################################
# Test cmd line op sanity.
# #############################################################################
my $output = `$trunk/bin/pt-query-digest --review h=127.1,P=12345,u=msandbox,p=msandbox`;
like($output, qr/--review DSN requires a D/, 'Dies if no D part in --review DSN');
for my $opt (qw(review-table history-table)) {
$output = `$cmd --review h=127.1,P=12345,u=msandbox,p=msandbox --$opt test`;
like($output, qr/--$opt should be passed a/, "Dies if no database part in --$opt");
}
$output = `$trunk/bin/pt-query-digest --review h=127.1,P=12345,u=msandbox,p=msandbox,D=test`;
like($output, qr/--review DSN requires a D/, 'Dies if no t part in --review DSN');
$output = `$cmd --review h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=test`;
like($output, qr/--review does not accept a t option/, 'Dies if t part in --review DSN');
like(
$help,
qr/review-table\s+\Qpercona_schema.query_review\E/,
"--review-table has a sane default"
);
like(
$help,
qr/history-table\s+\Qpercona_schema.query_history\E/,
"--history-table has a sane default"
);
# #############################################################################
# https://bugs.launchpad.net/percona-toolkit/+bug/885382
@@ -34,25 +53,25 @@ my @options = qw(
--group-by file
);
$output = `$trunk/bin/pt-query-digest @options --embedded-attributes '-- .*' $sample.slow010.txt`;
$output = `$cmd @options --embedded-attributes '-- .*' $sample.slow010.txt`;
like $output,
qr/\Q--embedded-attributes should be passed two comma-separated patterns, got 1/,
'Bug 885382: --embedded-attributes cardinality';
$output = `$trunk/bin/pt-query-digest @options --embedded-attributes '-- .*,(?{1234})' $sample.slow010.txt`;
$output = `$cmd @options --embedded-attributes '-- .*,(?{1234})' $sample.slow010.txt`;
like $output,
qr/\Q--embedded-attributes Eval-group /,
"Bug 885382: --embedded-attributes rejects invalid patterns early";
$output = `$trunk/bin/pt-query-digest @options --embedded-attributes '-- .*,(?*asdasd' $sample.slow010.txt`;
$output = `$cmd @options --embedded-attributes '-- .*,(?*asdasd' $sample.slow010.txt`;
like $output,
qr/\Q--embedded-attributes Sequence (?*...) not recognized/,
"Bug 885382: --embedded-attributes rejects invalid patterns early";
$output = `$trunk/bin/pt-query-digest @options --embedded-attributes '-- .*,[:alpha:]' $sample.slow010.txt`;
$output = `$cmd @options --embedded-attributes '-- .*,[:alpha:]' $sample.slow010.txt`;
like $output,
qr/\Q--embedded-attributes POSIX syntax [: :] belongs inside character/,
@@ -61,7 +80,7 @@ like $output,
# We removed --statistics, but they should still print out if we use PTDEBUG.
$output = qx{PTDEBUG=1 $trunk/bin/pt-query-digest --no-report ${sample}slow002.txt 2>&1};
$output = qx{PTDEBUG=1 $cmd --no-report ${sample}slow002.txt 2>&1};
my $stats = slurp_file("t/pt-query-digest/samples/stats-slow002.txt");
like(
@@ -81,14 +100,12 @@ like(
# https://bugs.launchpad.net/percona-toolkit/+bug/831525
# #############################################################################
$output = `$trunk/bin/pt-query-digest --help`;
like(
$output,
$help,
qr/\Q--report-format=A\E\s*
\QPrint these sections of the query analysis\E\s*
\Qreport (default rusage,date,hostname,files,\E\s*
\Qheader,profile,query_report,prepared)\E/x,
\Qreport (default rusage\E,\s*date,\s*hostname,\s*files,\s*
header,\s*profile,\s*query_report,\s*prepared\)/x,
"Bug 831525: pt-query-digest help output mangled"
);

View File

@@ -14,6 +14,10 @@ use Test::More;
use PerconaTest;
require "$trunk/bin/pt-query-digest";
no warnings 'once';
local $JSONReportFormatter::sorted_json = 1;
local $JSONReportFormatter::pretty_json = 1;
my @args = qw(--output json);
my $sample = "$trunk/t/lib/samples";
my $results = "t/pt-query-digest/samples";

163
t/pt-query-digest/resume.t Normal file
View File

@@ -0,0 +1,163 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More;
use IO::File;
use Fcntl qw(:seek);
use File::Temp qw(tempfile);
use PerconaTest;
use Sandbox;
require "$trunk/bin/pt-query-digest";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $dbh = $sb->get_dbh_for('master');
if ( !$dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
my $samples = "$trunk/t/lib/samples/slowlogs";
my $output;
$sb->create_dbs($dbh, ['test']);
my $resume_file = (tempfile())[1];
my ($fh, $filename) = tempfile(UNLINK => 1);
$fh->autoflush(1);
sub resume_offset_ok {
my ($resume_file, $file, $msg) = @_;
chomp(my $offset = slurp_file($resume_file));
open my $tmp_fh, q{<}, $file or die $OS_ERROR;
seek $tmp_fh, 0, SEEK_END;
is(tell($tmp_fh), $offset, $msg);
}
sub run_pqd {
my @extra_args = @_;
my $run = output(sub { pt_query_digest::main(qw(--limit 10), @extra_args, $filename) }, stderr => 1);
$run =~ s/\d+ms user time.+//;
$run =~ s/Current date: .+//;
return $run;
}
print { $fh } slurp_file("$samples/slow006.txt");
my @runs;
push @runs, run_pqd() for 1, 2;
is($runs[0], $runs[1], "Sanity check: Behaves the same between runs without --resume");
my @resume_runs;
push @resume_runs, run_pqd('--resume', $resume_file) for 1, 2;
(my $without_resume_line = $resume_runs[0]) =~ s/\n\n. Saved resume file offset.+//;
is(
$runs[0],
$without_resume_line,
"First time with --resume just like the first time without"
);
like(
$resume_runs[0],
qr/\QSaved resume file offset\E/,
"SAves offset with --resume"
);
like(
$resume_runs[1],
qr/\QNo events processed.\E/,
"..and there are no events on the second run"
);
resume_offset_ok($resume_file, $filename, "The resume file has the correct offset");
print { $fh } slurp_file("$samples/slow002.txt");
push @resume_runs, run_pqd('--resume', $resume_file) for 1, 2;
unlike(
$resume_runs[2],
qr/\QNo events processed.\E/,
"New run detects new events"
);
like(
$resume_runs[3],
qr/\QNo events processed.\E/,
"And running again after that finds nothing new"
);
resume_offset_ok($resume_file, $filename, "The resume file has the updated offset");
unlink($resume_file);
close $fh;
# #############################################################################
# Now test the itneraction with --run-time-mode interval
# #############################################################################
($fh, $filename) = tempfile(UNLINK => 1);
$fh->autoflush(1);
print { $fh } slurp_file("$trunk/t/lib/samples/slowlogs/slow033.txt");
my @run_args = (qw(--run-time-mode interval --run-time 1d --iterations 0),
qw(--report-format query_report));
my @resume_args = (@run_args, '--resume', $resume_file);
my @run_time;
push @run_time, run_pqd(@resume_args) for 1,2;
resume_offset_ok($resume_file, $filename, "The resume file has the correct offset when using --run-time-mode interval");
print { $fh } slurp_file("$samples/slow002.txt");
push @run_time, run_pqd(@resume_args) for 1,2;
resume_offset_ok($resume_file, $filename, "...and it updates correctly");
like(
$_,
qr/\QNo events processed.\E/,
"Runs 2 & 4 find no new data"
) for @run_time[1, 3];
# This shows up in the first report, but shouldn't show up in there
# third run, after we add new events to the file.
my $re = qr/\QSELECT * FROM foo\E/;
unlike(
$run_time[2],
$re,
"Events from the first run are correctly ignored"
);
my $no_resume = run_pqd(@run_args);
like(
$no_resume,
$re,
"...but do show up if run without resume"
);
# #############################################################################
# Done.
# #############################################################################
$sb->wipe_clean($dbh);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
done_testing;
exit;

View File

@@ -22,9 +22,6 @@ my $dbh = $sb->get_dbh_for('master');
if ( !$dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
else {
plan tests => 18;
}
sub normalize_numbers {
use Scalar::Util qw(looks_like_number);
@@ -43,21 +40,21 @@ $sb->load_file('master', 't/pt-query-digest/samples/query_review.sql');
# Test --create-review and --create-review-history-table
$output = 'foo'; # clear previous test results
$cmd = "${run_with}slow006.txt --create-review-table --review "
. "h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=query_review --create-review-history-table "
. "--review-history t=query_review_history";
$cmd = "${run_with}slow006.txt --create-review-tables --review "
. "h=127.1,P=12345,u=msandbox,p=msandbox --review-table test.query_review "
. "--history-table test.query_review_history";
$output = `$cmd >/dev/null 2>&1`;
my ($table) = $dbh->selectrow_array(
"show tables from test like 'query_review'");
is($table, 'query_review', '--create-review');
is($table, 'query_review', '--create-review-tables');
($table) = $dbh->selectrow_array(
"show tables from test like 'query_review_history'");
is($table, 'query_review_history', '--create-review-history-table');
is($table, 'query_review_history', '--create-review-tables');
$output = 'foo'; # clear previous test results
$cmd = "${run_with}slow006.txt --review h=127.1,u=msandbox,p=msandbox,P=12345,D=test,t=query_review "
. "--review-history t=query_review_history";
$cmd = "${run_with}slow006.txt --review h=127.1,u=msandbox,p=msandbox,P=12345 --review-table test.query_review "
. "--history-table test.query_review_history";
$output = `$cmd`;
my $res = $dbh->selectall_arrayref( 'SELECT * FROM test.query_review',
{ Slice => {} } );
@@ -181,17 +178,21 @@ is_deeply(
# have been reviewed, the report should include both of them with
# their respective query review info added to the report.
ok(
no_diff($run_with.'slow006.txt --review h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=query_review', "t/pt-query-digest/samples/slow006_AR_1.txt"),
no_diff($run_with.'slow006.txt --review h=127.1,P=12345,u=msandbox,p=msandbox --review-table test.query_review --create-review-tables', "t/pt-query-digest/samples/slow006_AR_1.txt"),
'Analyze-review pass 1 reports not-reviewed queries'
);
($table) = $dbh->selectrow_array(
"show tables from percona_schema like 'query_history'");
is($table, 'query_history', '--create-review-tables creates both percona_schema and query_review_history');
# Mark a query as reviewed and run --report again and that query should
# not be reported.
$dbh->do('UPDATE test.query_review
SET reviewed_by="daniel", reviewed_on="2008-12-24 12:00:00", comments="foo_tbl is ok, so are cranberries"
WHERE checksum=11676753765851784517');
ok(
no_diff($run_with.'slow006.txt --review h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=query_review', "t/pt-query-digest/samples/slow006_AR_2.txt"),
no_diff($run_with.'slow006.txt --review h=127.1,P=12345,u=msandbox,p=msandbox --review-table test.query_review', "t/pt-query-digest/samples/slow006_AR_2.txt"),
'Analyze-review pass 2 does not report the reviewed query'
);
@@ -199,7 +200,7 @@ ok(
# to re-appear in the report with the reviewed_by, reviewed_on and comments
# info included.
ok(
no_diff($run_with.'slow006.txt --review h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=query_review --report-all', "t/pt-query-digest/samples/slow006_AR_4.txt"),
no_diff($run_with.'slow006.txt --review h=127.1,P=12345,u=msandbox,p=msandbox --review-table test.query_review --report-all', "t/pt-query-digest/samples/slow006_AR_4.txt"),
'Analyze-review pass 4 with --report-all reports reviewed query'
);
@@ -208,7 +209,7 @@ $dbh->do('ALTER TABLE test.query_review ADD COLUMN foo INT');
$dbh->do('UPDATE test.query_review
SET foo=42 WHERE checksum=15334040482108055940');
ok(
no_diff($run_with.'slow006.txt --review h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=query_review', "t/pt-query-digest/samples/slow006_AR_5.txt"),
no_diff($run_with.'slow006.txt --review h=127.1,P=12345,u=msandbox,p=msandbox --review-table test.query_review', "t/pt-query-digest/samples/slow006_AR_5.txt"),
'Analyze-review pass 5 reports new review info column'
);
@@ -217,7 +218,7 @@ ok(
$dbh->do("update test.query_review set first_seen='0000-00-00 00:00:00', "
. " last_seen='0000-00-00 00:00:00'");
$output = 'foo'; # clear previous test results
$cmd = "${run_with}slow022.txt --review h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=query_review";
$cmd = "${run_with}slow022.txt --review h=127.1,P=12345,u=msandbox,p=msandbox --review-table test.query_review";
$output = `$cmd`;
unlike($output, qr/last_seen/, 'no last_seen when 0000 timestamp');
unlike($output, qr/first_seen/, 'no first_seen when 0000 timestamp');
@@ -231,7 +232,7 @@ unlike($output, qr/0000-00-00 00:00:00/, 'no 0000-00-00 00:00:00 timestamp');
# Make sure a missing Time property does not cause a crash. Don't test data
# in table, because it varies based on when you run the test.
$output = 'foo'; # clear previous test results
$cmd = "${run_with}slow021.txt --review h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=query_review";
$cmd = "${run_with}slow021.txt --review h=127.1,P=12345,u=msandbox,p=msandbox --review-table test.query_review";
$output = `$cmd`;
unlike($output, qr/Use of uninitialized value/, 'didnt crash due to undef ts');
@@ -239,7 +240,7 @@ unlike($output, qr/Use of uninitialized value/, 'didnt crash due to undef ts');
# crash. Don't test data in table, because it varies based on when you run
# the test.
$output = 'foo'; # clear previous test results
$cmd = "${run_with}slow022.txt --review h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=query_review";
$cmd = "${run_with}slow022.txt --review h=127.1,P=12345,u=msandbox,p=msandbox --review-table test.query_review";
$output = `$cmd`;
# Don't test data in table, because it varies based on when you run the test.
unlike($output, qr/Use of uninitialized value/, 'no crash due to totally missing ts');
@@ -248,7 +249,7 @@ unlike($output, qr/Use of uninitialized value/, 'no crash due to totally missing
# --review --no-report
# #############################################################################
$sb->load_file('master', 't/pt-query-digest/samples/query_review.sql');
$output = `${run_with}slow006.txt --review h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=query_review --no-report --create-review-table`;
$output = `${run_with}slow006.txt --review h=127.1,P=12345,u=msandbox,p=msandbox --review-table test.query_review --no-report --create-review-table`;
$res = $dbh->selectall_arrayref('SELECT * FROM test.query_review');
is(
$res->[0]->[1],
@@ -268,7 +269,7 @@ is(
$dbh->do('truncate table test.query_review');
$dbh->do('truncate table test.query_review_history');
`${run_with}slow002.txt --review h=127.1,u=msandbox,p=msandbox,P=12345,D=test,t=query_review --review-history t=query_review_history --no-report --filter '\$event->{arg} =~ m/foo\.bar/' > /dev/null`;
`${run_with}slow002.txt --review h=127.1,u=msandbox,p=msandbox,P=12345 --review-table test.query_review --history-table test.query_review_history --no-report --filter '\$event->{arg} =~ m/foo\.bar/' > /dev/null`;
$res = $dbh->selectall_arrayref( 'SELECT * FROM test.query_review_history',
{ Slice => {} } );
@@ -396,8 +397,9 @@ $dbh->do($min_tbl);
$output = output(
sub { pt_query_digest::main(
'--review', 'h=127.1,u=msandbox,p=msandbox,P=12345,D=test,t=query_review',
'--review-history', 't=query_review_history',
'--review', 'h=127.1,u=msandbox,p=msandbox,P=12345',
'--review-table', 'test.query_review',
'--history-table', 'test.query_review_history',
qw(--no-report --no-continue-on-error),
"$trunk/t/lib/samples/slow002.txt")
},
@@ -415,4 +417,5 @@ unlike(
# #############################################################################
$sb->wipe_clean($dbh);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
done_testing;
exit;

View File

@@ -1,14 +1,12 @@
# Profile
# Rank Query ID Response time Calls R/Call Apdx V/M EXPLAIN Item
# ==== ================== ============= ===== ====== ==== ===== ======= ========
# 1 0xD4B6A5CD2F2F485C 0.2148 100.0% 1 0.2148 1.00 0.00 TF>aa SELECT t
# Rank Query ID Response time Calls R/Call V/M Item
# ==== ================== ============= ===== ====== ===== ========
# 1 0xD4B6A5CD2F2F485C 0.2148 100.0% 1 0.2148 0.00 SELECT t
# Query 1: 0 QPS, 0x concurrency, ID 0xD4B6A5CD2F2F485C at byte 0 ________
# This item is included in the report because it matches --limit.
# Scores: Apdex = 1.00 [1.0]*, V/M = 0.00
# EXPLAIN sparkline: TF>aa
# Query_time sparkline: | ^ |
# Scores: V/M = 0.00
# Time range: all events occurred at 2010-12-14 16:12:28
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======

View File

@@ -1,2 +1,203 @@
[{"class":{"checksum":"66825DDC008FFA89","ts_min":"2007-12-18 11:48:27","ts_max":"2007-12-18 11:48:27","fingerprint":"update d?tuningdetail_?_? n inner join d?gonzo a using(gonzo) set n.column? = a.column?, n.word? = a.word?","sample":"update db2.tuningdetail_21_265507 n\n inner join db1.gonzo a using(gonzo) \n set n.column1 = a.column1, n.word3 = a.word3","cnt":1},"attributes":{"bytes":{"pct":"0.12","avg":"129.000000","min":"129.000000","max":"129.000000","median":"129.000000","cnt":"1.000000","stddev":0,"pct_95":"129.000000","sum":"129.000000"},"db":{"pct":0.142857142857143,"avg":0,"min":"db1","max":"db1","median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":null},"Full_join":{"pct":0.125,"avg":0,"min":0,"max":0,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":0},"Merge_passes":{"pct":"0.12","avg":0,"min":"0","max":"0","median":0,"cnt":"1.000000","stddev":0,"pct_95":0,"sum":0},"Filesort":{"pct":0.125,"avg":0,"min":0,"max":0,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":0},"user":{"pct":0.125,"avg":0,"min":"[SQL_SLAVE]","max":"[SQL_SLAVE]","median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":null},"Rows_sent":{"pct":"0.12","avg":0,"min":"0","max":"0","median":0,"cnt":"1.000000","stddev":0,"pct_95":0,"sum":0},"Lock_time":{"pct":"0.12","avg":"0.000091","min":"0.000091","max":"0.000091","median":"0.000091","cnt":"1.000000","stddev":0,"pct_95":"0.000091","sum":"0.000091"},"Full_scan":{"pct":0.125,"avg":1,"min":1,"max":1,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":1},"Filesort_on_disk":{"pct":0.125,"avg":0,"min":0,"max":0,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":0},"host":{"pct":0.125,"avg":0,"min":"","max":"","median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":null},"pos_in_log":{"pct":"0.12","avg":"338.000000","min":"338.000000","max":"338.000000","median":"338.000000","cnt":"1.000000","stddev":0,"pct_95":"338.000000","sum":"338.000000"},"Tmp_table":{"pct":0.125,"avg":0,"min":0,"max":0,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":0},"QC_Hit":{"pct":0.125,"avg":0,"min":0,"max":0,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":0},"Tmp_table_on_disk":{"pct":0.125,"avg":0,"min":0,"max":0,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":0},"Rows_examined":{"pct":"0.12","avg":"62951.000000","min":"62951.000000","max":"62951.000000","median":"62951.000000","cnt":"1.000000","stddev":0,"pct_95":"62951.000000","sum":"62951.000000"},"Query_time":{"pct":"0.12","avg":"0.726052","min":"0.726052","max":"0.726052","median":"0.726052","cnt":"1.000000","stddev":0,"pct_95":"0.726052","sum":"0.726052"}}}]
[
{
"attributes" : {
"Filesort" : {
"avg" : 0,
"cnt" : 1,
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : 0.125,
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"Filesort_on_disk" : {
"avg" : 0,
"cnt" : 1,
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : 0.125,
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"Full_join" : {
"avg" : 0,
"cnt" : 1,
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : 0.125,
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"Full_scan" : {
"avg" : 1,
"cnt" : 1,
"max" : 1,
"median" : 0,
"min" : 1,
"pct" : 0.125,
"pct_95" : 0,
"stddev" : 0,
"sum" : 1
},
"Lock_time" : {
"avg" : "0.000091",
"cnt" : "1.000000",
"max" : "0.000091",
"median" : "0.000091",
"min" : "0.000091",
"pct" : "0.12",
"pct_95" : "0.000091",
"stddev" : 0,
"sum" : "0.000091"
},
"Merge_passes" : {
"avg" : 0,
"cnt" : "1.000000",
"max" : "0",
"median" : 0,
"min" : "0",
"pct" : "0.12",
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"QC_Hit" : {
"avg" : 0,
"cnt" : 1,
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : 0.125,
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"Query_time" : {
"avg" : "0.726052",
"cnt" : "1.000000",
"max" : "0.726052",
"median" : "0.726052",
"min" : "0.726052",
"pct" : "0.12",
"pct_95" : "0.726052",
"stddev" : 0,
"sum" : "0.726052"
},
"Rows_examined" : {
"avg" : "62951.000000",
"cnt" : "1.000000",
"max" : "62951.000000",
"median" : "62951.000000",
"min" : "62951.000000",
"pct" : "0.12",
"pct_95" : "62951.000000",
"stddev" : 0,
"sum" : "62951.000000"
},
"Rows_sent" : {
"avg" : 0,
"cnt" : "1.000000",
"max" : "0",
"median" : 0,
"min" : "0",
"pct" : "0.12",
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"Tmp_table" : {
"avg" : 0,
"cnt" : 1,
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : 0.125,
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"Tmp_table_on_disk" : {
"avg" : 0,
"cnt" : 1,
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : 0.125,
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"bytes" : {
"avg" : "129.000000",
"cnt" : "1.000000",
"max" : "129.000000",
"median" : "129.000000",
"min" : "129.000000",
"pct" : "0.12",
"pct_95" : "129.000000",
"stddev" : 0,
"sum" : "129.000000"
},
"db" : {
"avg" : 0,
"cnt" : 1,
"max" : "db1",
"median" : 0,
"min" : "db1",
"pct" : 0.142857142857143,
"pct_95" : 0,
"stddev" : 0,
"sum" : null
},
"host" : {
"avg" : 0,
"cnt" : 1,
"max" : "",
"median" : 0,
"min" : "",
"pct" : 0.125,
"pct_95" : 0,
"stddev" : 0,
"sum" : null
},
"pos_in_log" : {
"avg" : "338.000000",
"cnt" : "1.000000",
"max" : "338.000000",
"median" : "338.000000",
"min" : "338.000000",
"pct" : "0.12",
"pct_95" : "338.000000",
"stddev" : 0,
"sum" : "338.000000"
},
"user" : {
"avg" : 0,
"cnt" : 1,
"max" : "[SQL_SLAVE]",
"median" : 0,
"min" : "[SQL_SLAVE]",
"pct" : 0.125,
"pct_95" : 0,
"stddev" : 0,
"sum" : null
}
},
"class" : {
"checksum" : "66825DDC008FFA89",
"cnt" : 1,
"fingerprint" : "update d?tuningdetail_?_? n inner join d?gonzo a using(gonzo) set n.column? = a.column?, n.word? = a.word?",
"sample" : "update db2.tuningdetail_21_265507 n\n inner join db1.gonzo a using(gonzo) \n set n.column1 = a.column1, n.word3 = a.word3",
"ts_max" : "2007-12-18 11:48:27",
"ts_min" : "2007-12-18 11:48:27"
}
}
]

View File

@@ -1,2 +1,359 @@
[{"class":{"checksum":"AA8E9FA785927259","ts_min":"2009-12-08 09:23:49.637394","ts_max":"2009-12-08 09:23:49.637394","fingerprint":"prepare select i from d.t where i=?","sample":"PREPARE SELECT i FROM d.t WHERE i=?","cnt":1},"attributes":{"bytes":{"pct":"0.33","avg":"35.000000","min":"35.000000","max":"35.000000","median":"35.000000","cnt":"1.000000","stddev":0,"pct_95":"35.000000","sum":"35.000000"},"No_good_index_used":{"pct":0.333333333333333,"avg":0,"min":0,"max":0,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":0},"No_index_used":{"pct":0.333333333333333,"avg":0,"min":0,"max":0,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":0},"host":{"pct":0.333333333333333,"avg":0,"min":"127.0.0.1","max":"127.0.0.1","median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":null},"pos_in_log":{"pct":"0.33","avg":0,"min":0,"max":0,"median":0,"cnt":"1.000000","stddev":0,"pct_95":0,"sum":0},"Rows_affected":{"pct":"0.33","avg":0,"min":0,"max":0,"median":0,"cnt":"1.000000","stddev":0,"pct_95":0,"sum":0},"Statement_id":{"pct":0.5,"avg":0,"min":2,"max":2,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":null},"Error_no":{"pct":0.333333333333333,"avg":0,"min":"none","max":"none","median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":null},"Query_time":{"pct":"0.33","avg":"0.000286","min":"0.000286","max":"0.000286","median":"0.000286","cnt":"1.000000","stddev":0,"pct_95":"0.000286","sum":"0.000286"},"Warning_count":{"pct":"0.33","avg":0,"min":0,"max":0,"median":0,"cnt":"1.000000","stddev":0,"pct_95":0,"sum":0}}},{"class":{"checksum":"3F79759E7FA2F117","ts_min":"2009-12-08 09:23:49.637892","ts_max":"2009-12-08 09:23:49.637892","fingerprint":"execute select i from d.t where i=?","sample":"EXECUTE SELECT i FROM d.t WHERE i=\"3\"","cnt":1},"attributes":{"bytes":{"pct":"0.33","avg":"37.000000","min":"37.000000","max":"37.000000","median":"37.000000","cnt":"1.000000","stddev":0,"pct_95":"37.000000","sum":"37.000000"},"No_good_index_used":{"pct":0.333333333333333,"avg":0,"min":0,"max":0,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":0},"No_index_used":{"pct":0.333333333333333,"avg":1,"min":1,"max":1,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":1},"host":{"pct":0.333333333333333,"avg":0,"min":"127.0.0.1","max":"127.0.0.1","median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":null},"pos_in_log":{"pct":"0.33","avg":"1106.000000","min":"1106.000000","max":"1106.000000","median":"1106.000000","cnt":"1.000000","stddev":0,"pct_95":"1106.000000","sum":"1106.000000"},"Rows_affected":{"pct":"0.33","avg":0,"min":0,"max":0,"median":0,"cnt":"1.000000","stddev":0,"pct_95":0,"sum":0},"Statement_id":{"pct":0.5,"avg":0,"min":"2","max":"2","median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":null},"Error_no":{"pct":0.333333333333333,"avg":0,"min":"none","max":"none","median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":null},"Query_time":{"pct":"0.33","avg":"0.000281","min":"0.000281","max":"0.000281","median":"0.000281","cnt":"1.000000","stddev":0,"pct_95":"0.000281","sum":"0.000281"},"Warning_count":{"pct":"0.33","avg":0,"min":0,"max":0,"median":0,"cnt":"1.000000","stddev":0,"pct_95":0,"sum":0}}},{"class":{"checksum":"AA353644DE4C4CB4","ts_min":"2009-12-08 09:23:49.638381","ts_max":"2009-12-08 09:23:49.638381","fingerprint":"administrator command: Quit","sample":"administrator command: Quit","cnt":1},"attributes":{"bytes":{"pct":"0.33","avg":"27.000000","min":"27.000000","max":"27.000000","median":"27.000000","cnt":"1.000000","stddev":0,"pct_95":"27.000000","sum":"27.000000"},"No_good_index_used":{"pct":0.333333333333333,"avg":0,"min":0,"max":0,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":0},"No_index_used":{"pct":0.333333333333333,"avg":0,"min":0,"max":0,"median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":0},"host":{"pct":0.333333333333333,"avg":0,"min":"127.0.0.1","max":"127.0.0.1","median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":null},"pos_in_log":{"pct":"0.33","avg":"1850.000000","min":"1850.000000","max":"1850.000000","median":"1850.000000","cnt":"1.000000","stddev":0,"pct_95":"1850.000000","sum":"1850.000000"},"Rows_affected":{"pct":"0.33","avg":0,"min":0,"max":0,"median":0,"cnt":"1.000000","stddev":0,"pct_95":0,"sum":0},"Error_no":{"pct":0.333333333333333,"avg":0,"min":"none","max":"none","median":0,"cnt":1,"stddev":0,"pct_95":0,"sum":null},"Query_time":{"pct":"0.33","avg":0,"min":"0.000000","max":"0.000000","median":"0.000000","cnt":"1.000000","stddev":0,"pct_95":"0.000000","sum":0},"Warning_count":{"pct":"0.33","avg":0,"min":0,"max":0,"median":0,"cnt":"1.000000","stddev":0,"pct_95":0,"sum":0}}}]
[
{
"attributes" : {
"Error_no" : {
"avg" : 0,
"cnt" : 1,
"max" : "none",
"median" : 0,
"min" : "none",
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : null
},
"No_good_index_used" : {
"avg" : 0,
"cnt" : 1,
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"No_index_used" : {
"avg" : 0,
"cnt" : 1,
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"Query_time" : {
"avg" : "0.000286",
"cnt" : "1.000000",
"max" : "0.000286",
"median" : "0.000286",
"min" : "0.000286",
"pct" : "0.33",
"pct_95" : "0.000286",
"stddev" : 0,
"sum" : "0.000286"
},
"Rows_affected" : {
"avg" : 0,
"cnt" : "1.000000",
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : "0.33",
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"Statement_id" : {
"avg" : 0,
"cnt" : 1,
"max" : 2,
"median" : 0,
"min" : 2,
"pct" : 0.5,
"pct_95" : 0,
"stddev" : 0,
"sum" : null
},
"Warning_count" : {
"avg" : 0,
"cnt" : "1.000000",
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : "0.33",
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"bytes" : {
"avg" : "35.000000",
"cnt" : "1.000000",
"max" : "35.000000",
"median" : "35.000000",
"min" : "35.000000",
"pct" : "0.33",
"pct_95" : "35.000000",
"stddev" : 0,
"sum" : "35.000000"
},
"host" : {
"avg" : 0,
"cnt" : 1,
"max" : "127.0.0.1",
"median" : 0,
"min" : "127.0.0.1",
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : null
},
"pos_in_log" : {
"avg" : 0,
"cnt" : "1.000000",
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : "0.33",
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
}
},
"class" : {
"checksum" : "AA8E9FA785927259",
"cnt" : 1,
"fingerprint" : "prepare select i from d.t where i=?",
"sample" : "PREPARE SELECT i FROM d.t WHERE i=?",
"ts_max" : "2009-12-08 09:23:49.637394",
"ts_min" : "2009-12-08 09:23:49.637394"
}
},
{
"attributes" : {
"Error_no" : {
"avg" : 0,
"cnt" : 1,
"max" : "none",
"median" : 0,
"min" : "none",
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : null
},
"No_good_index_used" : {
"avg" : 0,
"cnt" : 1,
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"No_index_used" : {
"avg" : 1,
"cnt" : 1,
"max" : 1,
"median" : 0,
"min" : 1,
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : 1
},
"Query_time" : {
"avg" : "0.000281",
"cnt" : "1.000000",
"max" : "0.000281",
"median" : "0.000281",
"min" : "0.000281",
"pct" : "0.33",
"pct_95" : "0.000281",
"stddev" : 0,
"sum" : "0.000281"
},
"Rows_affected" : {
"avg" : 0,
"cnt" : "1.000000",
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : "0.33",
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"Statement_id" : {
"avg" : 0,
"cnt" : 1,
"max" : "2",
"median" : 0,
"min" : "2",
"pct" : 0.5,
"pct_95" : 0,
"stddev" : 0,
"sum" : null
},
"Warning_count" : {
"avg" : 0,
"cnt" : "1.000000",
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : "0.33",
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"bytes" : {
"avg" : "37.000000",
"cnt" : "1.000000",
"max" : "37.000000",
"median" : "37.000000",
"min" : "37.000000",
"pct" : "0.33",
"pct_95" : "37.000000",
"stddev" : 0,
"sum" : "37.000000"
},
"host" : {
"avg" : 0,
"cnt" : 1,
"max" : "127.0.0.1",
"median" : 0,
"min" : "127.0.0.1",
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : null
},
"pos_in_log" : {
"avg" : "1106.000000",
"cnt" : "1.000000",
"max" : "1106.000000",
"median" : "1106.000000",
"min" : "1106.000000",
"pct" : "0.33",
"pct_95" : "1106.000000",
"stddev" : 0,
"sum" : "1106.000000"
}
},
"class" : {
"checksum" : "3F79759E7FA2F117",
"cnt" : 1,
"fingerprint" : "execute select i from d.t where i=?",
"sample" : "EXECUTE SELECT i FROM d.t WHERE i=\"3\"",
"ts_max" : "2009-12-08 09:23:49.637892",
"ts_min" : "2009-12-08 09:23:49.637892"
}
},
{
"attributes" : {
"Error_no" : {
"avg" : 0,
"cnt" : 1,
"max" : "none",
"median" : 0,
"min" : "none",
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : null
},
"No_good_index_used" : {
"avg" : 0,
"cnt" : 1,
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"No_index_used" : {
"avg" : 0,
"cnt" : 1,
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"Query_time" : {
"avg" : 0,
"cnt" : "1.000000",
"max" : "0.000000",
"median" : "0.000000",
"min" : "0.000000",
"pct" : "0.33",
"pct_95" : "0.000000",
"stddev" : 0,
"sum" : 0
},
"Rows_affected" : {
"avg" : 0,
"cnt" : "1.000000",
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : "0.33",
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"Warning_count" : {
"avg" : 0,
"cnt" : "1.000000",
"max" : 0,
"median" : 0,
"min" : 0,
"pct" : "0.33",
"pct_95" : 0,
"stddev" : 0,
"sum" : 0
},
"bytes" : {
"avg" : "27.000000",
"cnt" : "1.000000",
"max" : "27.000000",
"median" : "27.000000",
"min" : "27.000000",
"pct" : "0.33",
"pct_95" : "27.000000",
"stddev" : 0,
"sum" : "27.000000"
},
"host" : {
"avg" : 0,
"cnt" : 1,
"max" : "127.0.0.1",
"median" : 0,
"min" : "127.0.0.1",
"pct" : 0.333333333333333,
"pct_95" : 0,
"stddev" : 0,
"sum" : null
},
"pos_in_log" : {
"avg" : "1850.000000",
"cnt" : "1.000000",
"max" : "1850.000000",
"median" : "1850.000000",
"min" : "1850.000000",
"pct" : "0.33",
"pct_95" : "1850.000000",
"stddev" : 0,
"sum" : "1850.000000"
}
},
"class" : {
"checksum" : "AA353644DE4C4CB4",
"cnt" : 1,
"fingerprint" : "administrator command: Quit",
"sample" : "administrator command: Quit",
"ts_max" : "2009-12-08 09:23:49.638381",
"ts_min" : "2009-12-08 09:23:49.638381"
}
}
]

View File

@@ -1,9 +1,7 @@
# Query 1: 0 QPS, 0x concurrency, ID 0x8E306CDB7A800841 at byte 0 ________
# This item is included in the report because it matches --limit.
# Scores: Apdex = 1.00 [1.0]*, V/M = 0.00
# EXPLAIN sparkline: s
# Query_time sparkline: | ^ |
# Scores: V/M = 0.00
# Time range: all events occurred at 2007-12-18 11:48:27
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======

View File

@@ -1,9 +1,7 @@
# Query 1: 0 QPS, 0x concurrency, ID 0x8E306CDB7A800841 at byte 0 ________
# This item is included in the report because it matches --limit.
# Scores: Apdex = 1.00 [1.0]*, V/M = 0.00
# EXPLAIN sparkline: s
# Query_time sparkline: | ^ |
# Scores: V/M = 0.00
# Time range: all events occurred at 2007-12-18 11:48:27
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======

View File

@@ -1,9 +1,7 @@
# Query 1: 0 QPS, 0x concurrency, ID 0x8E306CDB7A800841 at byte 0 ________
# This item is included in the report because it matches --limit.
# Scores: Apdex = 1.00 [1.0]*, V/M = 0.00
# EXPLAIN sparkline: I
# Query_time sparkline: | ^ |
# Scores: V/M = 0.00
# Time range: all events occurred at 2007-12-18 11:48:27
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======