From: Darold Gilles Date: Wed, 29 Oct 2014 14:36:26 +0000 (+0100) Subject: Redefine sessions duration histogram bound. Thanks to Guillaume Lelarge for the report. X-Git-Tag: v6.3~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fdb49c3ae98fa512b8aba3ee5b1eb841e8108aba;p=pgbadger Redefine sessions duration histogram bound. Thanks to Guillaume Lelarge for the report. --- diff --git a/pgbadger b/pgbadger index 34af63a..4feb2e2 100755 --- a/pgbadger +++ b/pgbadger @@ -841,7 +841,7 @@ map {$_ = quotemeta($_)} @BRACKETS; my @histogram_query_time = (0, 1, 5, 10, 25, 50, 100, 500, 1000, 10000); # Inbounds of session times histogram -my @histogram_session_time = (0, 1, 5, 10, 25, 50, 100, 500, 1000, 10000); +my @histogram_session_time = (0, 500, 1000, 30000, 60000, 600000, 1800000, 3600000, 28800000); # Get inbounds of query times histogram sub get_hist_inbound @@ -4867,7 +4867,8 @@ sub print_histogram_session_times my $most_range_value = ''; for (my $i = 1; $i <= $#histogram_session_time; $i++) { - $histogram_info .= "$histogram_session_time[$i-1]-$histogram_session_time[$i]ms" . &comma_numbers($overall_stat{histogram}{session_time}{$histogram_session_time[$i-1]}) . + #$histogram_info .= "$histogram_session_time[$i-1]-$histogram_session_time[$i]ms" . &comma_numbers($overall_stat{histogram}{session_time}{$histogram_session_time[$i-1]}) . + $histogram_info .= "" . &convert_time($histogram_session_time[$i-1]) . '-' . &convert_time($histogram_session_time[$i]) . "" . &comma_numbers($overall_stat{histogram}{session_time}{$histogram_session_time[$i-1]}) . "" . sprintf("%0.2f", ($overall_stat{histogram}{session_time}{$histogram_session_time[$i-1]} * 100) / ($overall_stat{histogram}{session_total}||1)) . "%"; $data{"$histogram_session_time[$i-1]-$histogram_session_time[$i]ms"} = $overall_stat{histogram}{session_time}{$histogram_session_time[$i-1]} if ($overall_stat{histogram}{session_time}{$histogram_session_time[$i-1]} > 0); if ($overall_stat{histogram}{session_time}{$histogram_session_time[$i-1]} > $most_range_value) { @@ -4876,7 +4877,8 @@ sub print_histogram_session_times } } if ($overall_stat{histogram}{session_total} > 0) { - $histogram_info .= " > $histogram_session_time[-1]ms" . &comma_numbers($overall_stat{histogram}{session_time}{'-1'}) . + #$histogram_info .= " > $histogram_session_time[-1]ms" . &comma_numbers($overall_stat{histogram}{session_time}{'-1'}) . + $histogram_info .= " > " . &convert_time($histogram_session_time[-1]) . "" . &comma_numbers($overall_stat{histogram}{session_time}{'-1'}) . "" . sprintf("%0.2f", ($overall_stat{histogram}{session_time}{'-1'} * 100) / ($overall_stat{histogram}{session_total}||1)) . "%"; $data{"> $histogram_session_time[-1]ms"} = $overall_stat{histogram}{session_time}{"-1"} if ($overall_stat{histogram}{session_time}{"-1"} > 0); if ($overall_stat{histogram}{session_time}{"-1"} > $most_range_value) {