LP #1086259: pt-kill --log-dsn timestamp is wrong

Description

**Reported in Launchpad by Walter Heck last update 14-01-2013 22:18:59

I'm running pt-kill as a cronjob with the following command:
<pre>
[root@orrville ~]# crontab -l
*/30 * * * * /usr/bin/pt-kill --user root --password r00t --kill --match-user api_filter --victims oldest --any-busy-time 300 --run-time 600 --verbose --create-log-table --log-dsn D=test,t=ptkill
</pre>

When it logs to the table, it seems to use the amount of seconds it has been running as the timestamp, while the unixtimestamp of the current time and date would be much more helpful:

<pre>
MariaDB [test]> select * from ptkill order by kill_id desc limit 2;
-----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------

kill_id

server_id

timestamp

reason

kill_error

Id

User

Host

db

Command

Time

State

Info

Time_ms

-----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------

205

10076

1970-01-01 00:00:02

Query matches User spec
Query matches User spec

 

5638802

api_filter

192.168.100.93:60309

yomama

Sleep

426

 

NULL

NULL

203

10076

1970-01-01 00:00:32

Query matches User spec

 

5638712

api_filter

192.168.100.66:58399

yomama

Sleep

406

 

NULL

NULL

-----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------
2 rows in set (0.00 sec)
</pre>

Environment

None

Smart Checklist

Activity

lpjirasync January 24, 2018 at 4:04 PM

**Comment from Launchpad by: Walter Heck on: 04-12-2012 06:22:32

Just confirmed it happens with 2.1.7 as well..

lpjirasync January 24, 2018 at 4:04 PM

**Comment from Launchpad by: Walter Heck on: 04-12-2012 06:08:23

This is on centos 5.8 and percona-toolkit 2.0.3 (sorry, can't test with latest):

[root@orrville ~]# cat /etc/redhat-release
CentOS release 5.8 (Final)

Done

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 4:03 PM
Updated January 24, 2018 at 4:04 PM
Resolved January 24, 2018 at 4:04 PM