Simplified code. Verified SlowLogParser module is correctly in sync with tools. Renamed test slow log files.

This commit is contained in:
Frank Cizmich
2014-07-30 17:25:29 -03:00
parent af185fbc28
commit abe635b6b0
9 changed files with 62 additions and 80 deletions

View File

@@ -161,14 +161,13 @@ sub parse_event {
if ( !$got_uh
&& ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o )
) {
if ($thread_id) { # 5.6 has the thread id on the User@Host line
PTDEBUG && _d("Got user, host, ip, Thread_id", $user, $host, $thread_id);
push @properties, 'user', $user, 'host', $host, 'ip', $ip, 'Thread_id', $thread_id;
}else{
PTDEBUG && _d("Got user, host, ip", $user, $host, $ip);
push @properties, 'user', $user, 'host', $host, 'ip', $ip;
}
++$got_uh;
PTDEBUG && _d("Got user, host, ip", $user, $host, $ip);
push @properties, 'user', $user, 'host', $host, 'ip', $ip;
# 5.6 has the thread id on the User@Host line
if ( $thread_id ) {
push @properties, 'Thread_id', $thread_id;
}
++$got_uh;
}
}
@@ -177,13 +176,12 @@ sub parse_event {
elsif ( !$got_uh
&& ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o )
) {
if ($thread_id) { # 5.6 has the thread id on the User@Host line
PTDEBUG && _d("Got user, host, ip, Thread_id", $user, $host, $thread_id);
push @properties, 'user', $user, 'host', $host, 'ip', $ip, 'Thread_id', $thread_id;
}else{
PTDEBUG && _d("Got user, host, ip", $user, $host, $ip);
push @properties, 'user', $user, 'host', $host, 'ip', $ip;
}
PTDEBUG && _d("Got user, host, ip", $user, $host, $ip);
push @properties, 'user', $user, 'host', $host, 'ip', $ip;
# 5.6 has the thread id on the User@Host line
if ( $thread_id ) {
push @properties, 'Thread_id', $thread_id;
}
++$got_uh;
}