]> granicus.if.org Git - pgbadger/commitdiff
Fix reports with histogram that was not showing data upper than the last range.
authorGilles Darold <gilles.darold@dalibo.com>
Sat, 28 Jan 2017 19:04:30 +0000 (20:04 +0100)
committerGilles Darold <gilles.darold@dalibo.com>
Sat, 28 Jan 2017 19:04:30 +0000 (20:04 +0100)
pgbadger

index e81ca36816089402eb10056d10f940bd99027f84..f18ae7fa6b38bbba858bab9cb91d95c6f5bfcb61 100644 (file)
--- a/pgbadger
+++ b/pgbadger
@@ -9476,6 +9476,8 @@ sub print_histogram_query_times
                }
        }
        if ($overall_stat{histogram}{query_total} > 0) {
+
+               $data{"> $histogram_query_time[-1]ms"} = ($overall_stat{histogram}{query_time}{"-1"} || 0);
                $histogram_info .= "<tr><td> &gt; $histogram_query_time[-1]ms</td><td>" . &comma_numbers($overall_stat{histogram}{query_time}{'-1'}) .
                        "</td><td>" . sprintf("%0.2f", ($overall_stat{histogram}{query_time}{'-1'} * 100) / ($overall_stat{histogram}{query_total}||1)) . "%</td></tr>";
                $data{"> $histogram_query_time[-1]ms"} = $overall_stat{histogram}{query_time}{"-1"} if ($overall_stat{histogram}{query_time}{"-1"} > 0);
@@ -13971,7 +13973,8 @@ sub jqplot_duration_histograph
                 my $lbl = "'" . &convert_time($range->[$i-1]) . '-' . &convert_time($range->[$i]) . "'";
                $bars .= "[ $lbl, $data{$k}],";
        }
-       $bars =~ s/,$//;
+       my $k = "> $range->[-1]ms";
+       $bars .= "[ '> " . &convert_time($range->[-1]) . "', $data{$k}]";
        my $title = '';
 
        return <<EOF;