]> granicus.if.org Git - pgbadger/commitdiff
Do not increment queries duration histogram when prepare|parse|bind log are found...
authorDarold Gilles <gilles@darold.net>
Thu, 27 Mar 2014 08:59:29 +0000 (09:59 +0100)
committerDarold Gilles <gilles@darold.net>
Thu, 27 Mar 2014 08:59:29 +0000 (09:59 +0100)
pgbadger

index 553787c6c666298e19be47b026e0856e97d803ce..9ce67ef48f77b3a8d8835e393f1d5ebd926b05bc 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -8387,15 +8387,15 @@ sub parse_query
        {
                $prefix_vars{'t_duration'} = $1;
                $t_action = $2;
-               my $k = &get_hist_inbound($1);
-               $overall_stat{histogram}{query_time}{$k}++;
-               $overall_stat{histogram}{total}++;
                $t_action =~ s/ from fetch//;
                $t_action = 'prepare' if ($t_action eq 'parse');
                $overall_stat{$t_action}++;
                $per_minute_info{$date_part}{$prefix_vars{'t_hour'}}{$prefix_vars{'t_min'}}{$t_action}++;
                # Skipping parse and bind logs
                return if ($t_action !~ /query|statement|execute/);
+               my $k = &get_hist_inbound($prefix_vars{'t_duration'});
+               $overall_stat{histogram}{query_time}{$k}++;
+               $overall_stat{histogram}{total}++;
        # Log line without duration at all
        } elsif ($prefix_vars{'t_query'} =~ s/(query|statement): //is) {
                $t_action = $1;