mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-26 15:31:55 +00:00
Merge trunk r174.
This commit is contained in:
@@ -30,7 +30,7 @@ else {
|
||||
# Issue 1186: mk-query-digest --processlist --interval --filter ignores interval
|
||||
# #############################################################################
|
||||
|
||||
my $output = `MKDEBUG=1 $trunk/bin/pt-query-digest --processlist h=127.1,P=12345,u=msandbox,p=msandbox --run-time 2 --port 12345 --interval .5 2>&1`;
|
||||
my $output = `PTDEBUG=1 $trunk/bin/pt-query-digest --processlist h=127.1,P=12345,u=msandbox,p=msandbox --run-time 2 --port 12345 --interval .5 2>&1`;
|
||||
|
||||
my @times = $output =~ m/Current time: \S+/g;
|
||||
ok(
|
||||
@@ -38,7 +38,7 @@ ok(
|
||||
"--interval limits number of processlist polls (issue 1186)"
|
||||
);
|
||||
|
||||
$output = `MKDEBUG=1 $trunk/bin/pt-query-digest --processlist h=127.1,P=12345,u=msandbox,p=msandbox --run-time 2 --port 12345 --interval .5 --filter '(\$event->{arg} =~ /NEVER HAPPEN/)' 2>&1`;
|
||||
$output = `PTDEBUG=1 $trunk/bin/pt-query-digest --processlist h=127.1,P=12345,u=msandbox,p=msandbox --run-time 2 --port 12345 --interval .5 --filter '(\$event->{arg} =~ /NEVER HAPPEN/)' 2>&1`;
|
||||
|
||||
@times = $output =~ m/Current time: \S+/g;
|
||||
ok(
|
||||
|
@@ -20,7 +20,7 @@ my $run_with = "$trunk/bin/pt-query-digest --report-format=query_report --limit
|
||||
# #############################################################################
|
||||
my $output = 'foo'; # clear previous test results
|
||||
my $cmd = "${run_with}slow026.txt";
|
||||
$output = `MKDEBUG=1 $cmd 2>&1`;
|
||||
$output = `PTDEBUG=1 $cmd 2>&1`;
|
||||
# Changed qr// from matching db to Schema because attribs are auto-detected.
|
||||
like(
|
||||
$output,
|
||||
|
@@ -33,6 +33,9 @@ else {
|
||||
|
||||
my $output;
|
||||
my $cmd;
|
||||
my $pid_file = "/tmp/pt-query-digest-mirror-test.pid";
|
||||
|
||||
diag(`rm $pid_file 2>/dev/null`);
|
||||
|
||||
my $pid_file = '/tmp/pt-query-digest.test.pid';
|
||||
`rm -rf $pid_file >/dev/null`;
|
||||
@@ -47,19 +50,23 @@ $cmd = "$trunk/bin/pt-query-digest "
|
||||
. "--execute h=127.1,P=12346,u=msandbox,p=msandbox --mirror 1 "
|
||||
. "--pid $pid_file";
|
||||
|
||||
$ENV{MKDEBUG}=1;
|
||||
$ENV{PTDEBUG}=1;
|
||||
`$cmd > /tmp/read_only.txt 2>&1 &`;
|
||||
|
||||
$ENV{MKDEBUG}=0;
|
||||
sleep 3;
|
||||
|
||||
$dbh1->do('select sleep(1)');
|
||||
sleep 1;
|
||||
$dbh1->do('set global read_only=1');
|
||||
$dbh2->do('set global read_only=0');
|
||||
$dbh1->do('select sleep(1)');
|
||||
|
||||
sleep 1;
|
||||
chomp(my $pid = `cat $pid_file`);
|
||||
kill 15, $pid;
|
||||
sleep 0.25;
|
||||
|
||||
# Verify that it's dead...
|
||||
$output = `ps x | grep '^[ ]*$pid'`;
|
||||
is(
|
||||
@@ -67,6 +74,10 @@ is(
|
||||
'',
|
||||
'It is stopped now'
|
||||
);
|
||||
=======
|
||||
$output = `ps -p $output`;
|
||||
unlike($output, qr/pt-query-digest/, 'It is stopped now');
|
||||
>>>>>>> MERGE-SOURCE
|
||||
|
||||
$output = `grep read_only /tmp/read_only.txt`;
|
||||
# Sample output:
|
||||
@@ -93,6 +104,7 @@ diag(`rm -rf /tmp/read_only.txt`);
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
diag(`rm $pid_file 2>/dev/null`);
|
||||
$dbh1->do('set global read_only=0');
|
||||
$dbh2->do('set global read_only=1');
|
||||
$sb->wipe_clean($dbh1);
|
||||
|
@@ -9,7 +9,7 @@ BEGIN {
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More tests => 6;
|
||||
use Test::More tests => 7;
|
||||
|
||||
use PerconaTest;
|
||||
|
||||
@@ -69,6 +69,18 @@ ok(
|
||||
'Analysis for tcpdump033 with prepared statements report'
|
||||
);
|
||||
|
||||
# ############################################################################
|
||||
# Bug 887688: Prepared statements crash pt-query-digest
|
||||
# ############################################################################
|
||||
ok(
|
||||
no_diff(
|
||||
sub { pt_query_digest::main(@args, $sample.'tcpdump041.txt',
|
||||
'--report-format', 'header,query_report,profile,prepared') },
|
||||
"t/pt-query-digest/samples/tcpdump041.txt",
|
||||
),
|
||||
'Analysis for tcpdump041 (bug 887688)'
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
52
t/pt-query-digest/samples/tcpdump041.txt
Normal file
52
t/pt-query-digest/samples/tcpdump041.txt
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
# Overall: 1 total, 1 unique, 0 QPS, 0x concurrency ______________________
|
||||
# Time range: all events occurred at 2009-12-08 09:23:49.637394
|
||||
# Attribute total min max avg 95% stddev median
|
||||
# ============ ======= ======= ======= ======= ======= ======= =======
|
||||
# Exec time 286us 286us 286us 286us 286us 0 286us
|
||||
# Rows affecte 0 0 0 0 0 0 0
|
||||
# Query size 35 35 35 35 35 0 35
|
||||
# Warning coun 0 0 0 0 0 0 0
|
||||
|
||||
# Query 1: 0 QPS, 0x concurrency, ID 0xAA8E9FA785927259 at byte 0 ________
|
||||
# This item is included in the report because it matches --limit.
|
||||
# Scores: Apdex = 1.00 [1.0]*, V/M = 0.00
|
||||
# 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
|
||||
# Rows affecte 0 0 0 0 0 0 0 0
|
||||
# Query size 100 35 35 35 35 35 0 35
|
||||
# Warning coun 0 0 0 0 0 0 0 0
|
||||
# String:
|
||||
# Errors none
|
||||
# Hosts 127.0.0.1
|
||||
# Statement id 2
|
||||
# Query_time distribution
|
||||
# 1us
|
||||
# 10us
|
||||
# 100us ################################################################
|
||||
# 1ms
|
||||
# 10ms
|
||||
# 100ms
|
||||
# 1s
|
||||
# 10s+
|
||||
# Tables
|
||||
# SHOW TABLE STATUS FROM `d` LIKE 't'\G
|
||||
# SHOW CREATE TABLE `d`.`t`\G
|
||||
PREPARE SELECT i FROM d.t WHERE i=?\G
|
||||
# Converted for EXPLAIN
|
||||
# EXPLAIN /*!50100 PARTITIONS*/
|
||||
SELECT i FROM d.t WHERE i=?\G
|
||||
|
||||
# Profile
|
||||
# Rank Query ID Response time Calls R/Call Apdx V/M Item
|
||||
# ==== ================== ============= ===== ====== ==== ===== ==========
|
||||
# 1 0xAA8E9FA785927259 0.0003 100.0% 1 0.0003 1.00 0.00 SELECT d.t
|
||||
|
||||
# Prepared statements
|
||||
# Rank Query ID PREP PREP Response EXEC EXEC Response Item
|
||||
# ==== ================== ==== ============= ==== ============= ==========
|
||||
# 1 0xAA8E9FA785927259 1 0.0003 100.0% 0 0.0000 0.0% SELECT d.t
|
Reference in New Issue
Block a user