Mini-overhaul pt-deadlock-logger: change --interval default from undef to 30, add --iterations, remove --print, add --quiet, use explicit --columns default, remove --collapse, change default --clear-deadlocks table to percona_schema.clear_deadlocks, refactor the code, use Cxn and Runtime, remove some global vars.

This commit is contained in:
Daniel Nichter
2013-02-25 17:19:32 -07:00
parent 6825fa7f3b
commit 8b428e28a1
7 changed files with 783 additions and 383 deletions

View File

@@ -0,0 +1,19 @@
CREATE TABLE deadlocks (
server char(20) NOT NULL,
ts datetime NOT NULL,
thread int unsigned NOT NULL,
txn_id bigint unsigned NOT NULL,
txn_time smallint unsigned NOT NULL,
user char(16) NOT NULL,
hostname char(20) NOT NULL,
ip char(15) NOT NULL, -- alternatively, ip int unsigned NOT NULL
db char(64) NOT NULL,
tbl char(64) NOT NULL,
idx char(64) NOT NULL,
lock_type char(16) NOT NULL,
lock_mode char(1) NOT NULL,
wait_hold char(1) NOT NULL,
victim tinyint unsigned NOT NULL,
query text NOT NULL,
PRIMARY KEY (server,ts,thread)
) ENGINE=InnoDB;