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

@@ -102,7 +102,6 @@ collect() {
log "Could not find the MySQL error log"
fi
ps_locks_transactions "$d/$p-ps-locks-transactions"
# Get a sample of these right away, so we can get these without interaction
# with the other commands we're about to run.
@@ -193,6 +192,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
# We check the disk, but don't exit, because we need to stop jobs if we
@@ -242,6 +247,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')"