From f509100a20f8dbabc99b0589bfa28f88dee115eb Mon Sep 17 00:00:00 2001 From: Darold Gilles Date: Thu, 27 Mar 2014 09:59:29 +0100 Subject: [PATCH] Do not increment queries duration histogram when prepare|parse|bind log are found, but only with execute log. Thanks to Josh Berkus for the report. --- pgbadger | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pgbadger b/pgbadger index 553787c..9ce67ef 100755 --- 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; -- 2.40.0