PT-81 Collect information about locks and transactions using P_S

This commit is contained in:
Carlos Salguero
2017-03-21 13:45:59 -03:00
parent b6bcf888e6
commit 4a056cf3b0
5 changed files with 95 additions and 2 deletions

View File

@@ -832,7 +832,6 @@ collect() {
log "Could not find the MySQL error log"
fi
ps_locks_transactions "$d/$p-ps-locks-transactions"
if [ "${mysql_version}" '>' "5.1" ]; then
local mutex="SHOW ENGINE INNODB MUTEX"
@@ -906,6 +905,12 @@ collect() {
log "Loop start: $(date +'TS %s.%N %F %T')"
local start_time=$(date +'%s')
local curr_time=$start_time
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
log "Performance Schema instrumentation is disabled"
fi
while [ $((curr_time - start_time)) -lt $OPT_RUN_TIME ]; do
disk_space $d > $d/$p-disk-space
@@ -948,6 +953,10 @@ collect() {
(echo $ts; transactions) >>"$d/$p-transactions" &
fi
if [ $ps_instrumentation_enabled == "yes" ]; then
ps_locks_transactions "$d/$p-ps-locks-transactions"
fi
curr_time=$(date +'%s')
done
log "Loop end: $(date +'TS %s.%N %F %T')"