]> granicus.if.org Git - pgbadger/commitdiff
Fix missing report of most frequent events/errors report. Thanks to Vincent Laborie...
authorDarold Gilles <gilles@darold.net>
Thu, 21 Feb 2013 23:21:35 +0000 (00:21 +0100)
committerDarold Gilles <gilles@darold.net>
Thu, 21 Feb 2013 23:21:35 +0000 (00:21 +0100)
pgbadger

index 62f9e589ede1cd5651fe08ea6233f6146e4d8a85..8aeec814d2ac96f5578c22a6a25d808ba6326db6 100755 (executable)
--- 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;