mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 07:30:02 +00:00
Merge branch '3.0' into issue-1642754
This commit is contained in:
26
bin/pt-stalk
26
bin/pt-stalk
@@ -813,8 +813,8 @@ collect() {
|
||||
>> "$d/$p-stacktrace"
|
||||
fi
|
||||
|
||||
$CMD_MYSQL $EXT_ARGV -e 'SHOW GLOBAL VARIABLES' >> "$d/$p-variables" &
|
||||
sleep .2
|
||||
collect_mysql_variables "$d/$p-variables" &
|
||||
sleep .5
|
||||
|
||||
local mysql_version="$(awk '/^version[^_]/{print substr($2,1,3)}' "$d/$p-variables")"
|
||||
|
||||
@@ -910,7 +910,7 @@ collect() {
|
||||
local ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e 'SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = "transaction";' \
|
||||
| sed "2q;d" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
|
||||
|
||||
if [ $ps_instrumentation_enabled != "yes"]; then
|
||||
if [ $ps_instrumentation_enabled != "yes" ]; then
|
||||
log "Performance Schema instrumentation is disabled"
|
||||
fi
|
||||
|
||||
@@ -1150,6 +1150,26 @@ slave_status() {
|
||||
fi
|
||||
}
|
||||
|
||||
collect_mysql_variables() {
|
||||
local outfile=$1
|
||||
|
||||
local sql="SHOW GLOBAL VARIABLES"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
sql="select * from performance_schema.user_variables_by_thread order by thread_id, variable_name;"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
sql="select * from performance_schema.status_by_thread order by thread_id, variable_name; "
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
}
|
||||
|
||||
# ###########################################################################
|
||||
# End collect package
|
||||
# ###########################################################################
|
||||
|
@@ -75,8 +75,8 @@ collect() {
|
||||
# Get MySQL's variables if possible. Then sleep long enough that we probably
|
||||
# complete SHOW VARIABLES if all's well. (We don't want to run mysql in the
|
||||
# foreground, because it could hang.)
|
||||
$CMD_MYSQL $EXT_ARGV -e 'SHOW GLOBAL VARIABLES' >> "$d/$p-variables" &
|
||||
sleep .2
|
||||
collect_mysql_variables "$d/$p-variables" &
|
||||
sleep .5
|
||||
|
||||
# Get the major.minor version number. Version 3.23 doesn't matter for our
|
||||
# purposes, and other releases have x.x.x* version conventions so far.
|
||||
@@ -195,7 +195,7 @@ collect() {
|
||||
local ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e 'SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = "transaction";' \
|
||||
| sed "2q;d" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
|
||||
|
||||
if [ $ps_instrumentation_enabled != "yes"]; then
|
||||
if [ $ps_instrumentation_enabled != "yes" ]; then
|
||||
log "Performance Schema instrumentation is disabled"
|
||||
fi
|
||||
|
||||
@@ -451,6 +451,28 @@ slave_status() {
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
collect_mysql_variables() {
|
||||
local outfile=$1
|
||||
|
||||
local sql="SHOW GLOBAL VARIABLES"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
sql="select * from performance_schema.variables_by_thread order by thread_id, variable_name;"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
sql="select * from performance_schema.user_variables_by_thread order by thread_id, variable_name;"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
sql="select * from performance_schema.status_by_thread order by thread_id, variable_name; "
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
}
|
||||
|
||||
# ###########################################################################
|
||||
|
Reference in New Issue
Block a user