From 8faabb7dca495ed4c0e033de34193ccbea55477e Mon Sep 17 00:00:00 2001 From: Darold Gilles Date: Fri, 22 Feb 2013 00:21:35 +0100 Subject: [PATCH] Fix missing report of most frequent events/errors report. Thanks to Vincent Laborie for the report. --- pgbadger | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pgbadger b/pgbadger index 62f9e58..8aeec81 100755 --- a/pgbadger +++ b/pgbadger @@ -3837,6 +3837,7 @@ sub dump_error_as_html sub show_error_as_html { + return if (scalar keys %error_info == 0); print $fh qq{ @@ -4804,7 +4805,6 @@ sub parse_query delete $cur_info{$t_pid}; } } - # When we are ready to overwrite the last storage, add it to the global stats if ( ($prefix_vars{'t_loglevel'} =~ /LOG|FATAL|PANIC|ERROR|WARNING|HINT/) && exists $cur_info{$t_pid} @@ -4846,6 +4846,8 @@ sub parse_query { $prefix_vars{'t_duration'} = $1; $t_action = $2; + # Skipping parse and bind logs + return if ($t_action !~ /query|statement|execute/); # Log line without duration at all } elsif ($prefix_vars{'t_query'} =~ s/(query|statement): //is) { $t_action = $1; @@ -4853,6 +4855,8 @@ sub parse_query } elsif ($prefix_vars{'t_query'} =~ s/(prepare|parse|bind|execute|execute from fetch)\s+[^:]+:\s//is) { $t_action = $1; + # Skipping parse and bind logs + return if ($t_action !~ /query|statement|execute/); # Log line that should not be parse } elsif ($prefix_vars{'t_loglevel'} eq 'LOG') { if ($prefix_vars{'t_query'} !~ @@ -4868,9 +4872,6 @@ sub parse_query return; } - # Skipping parse and bind logs - return if ($t_action !~ /query|statement|execute/); - &set_current_infos($t_pid); return 1; -- 2.40.0