From: Darold Gilles Date: Thu, 3 May 2012 20:39:03 +0000 (+0200) Subject: Allow download of graphics as PNG images X-Git-Tag: v3.2~248 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26de8df195efa976e67acd1c10ef9866851ef8c6;p=pgbadger Allow download of graphics as PNG images --- diff --git a/pgbadger b/pgbadger index 76b058d..44f47a4 100755 --- a/pgbadger +++ b/pgbadger @@ -59,8 +59,9 @@ my $regex_prefix_dbuser = ''; my $quiet = 0; my $progress = 0; my $NUMPROGRESS = 10000; -my @DIMENSIONS = (1000,400); +my @DIMENSIONS = (800,300); my $RESRC_URL = ''; +my $IMG_FORMAT = 'png'; my $t0 = Benchmark->new; @@ -1102,11 +1103,6 @@ sub dump_as_html } } delete $per_minute_info{query}; -# print $fh qq{ -# -# -# -#}; $d1 =~ s/,$//; $d2 =~ s/,$//; $d3 =~ s/,$//; @@ -1128,11 +1124,6 @@ sub dump_as_html $d2 .= "[$t, " . sprintf("%.2f", (($per_hour_info{$tm}{$h}{duration} || 0) / ($per_hour_info{$tm}{$h}{count} || 1)) /1000) . "],"; } } -# print $fh qq{ -# -# -# -#}; $d1 =~ s/,$//; $d2 =~ s/,$//; &flotr2_graph(2, 'allqueries_graph', $d1, '', '', 'All queries', @@ -1152,11 +1143,6 @@ sub dump_as_html $d2 .= "[$t, " . sprintf("%.2f", (($per_hour_info{$tm}{$h}{'SELECT'}{duration} || 0) / ($per_hour_info{$tm}{$h}{'SELECT'}{count} || 1)) /1000) . "],"; } } -# print $fh qq{ -# -# -# -#}; $d1 =~ s/,$//; $d2 =~ s/,$//; &flotr2_graph(3, 'selectqueries_graph', $d1, '', '', 'SELECT queries', @@ -1181,11 +1167,6 @@ sub dump_as_html $d4 .= "[$t, " . sprintf("%.2f", (($wduration || 0) / ($wcount || 1)) /1000) . "],"; } } -# print $fh qq{ -# -# -# -#}; $d1 =~ s/,$//; $d2 =~ s/,$//; $d3 =~ s/,$//; @@ -1209,12 +1190,6 @@ sub dump_as_html $d1 .= "[$t, " . ($checkpoint_info{chronos}{$tm}{$h}{wbuffer} || 0) . "],"; } } -# print $fh qq{ -# -# -# -#}; - $d1 =~ s/,$//; &flotr2_graph(5, 'checkpointwritebuffers_graph', $d1, '', '', 'Checkpoint write buffers', 'Buffers','Write buffers','',''); @@ -1234,11 +1209,6 @@ sub dump_as_html $d2 .= "[$t, " . ($tempfile_info{chronos}{$tm}{$h}{count} || 0) . "],"; } } -# print $fh qq{ -# -# -# -#}; $d1 =~ s/,$//; $d2 =~ s/,$//; &flotr2_graph(6, 'temporaryfile_graph', $d1, '', '', 'Temporary files', @@ -2163,6 +2133,11 @@ sub flotr2_graph