From: Darold Gilles Date: Fri, 25 Jan 2013 12:09:34 +0000 (+0100) Subject: Add pie graph to show repartition of number of autovacuum per table and number of... X-Git-Tag: v3.2~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=228821ed56257242897c1b983df80d56657ce135;p=pgbadger Add pie graph to show repartition of number of autovacuum per table and number of tuples removed by autovacuum per table. --- diff --git a/pgbadger b/pgbadger index 120f016..eec0d04 100755 --- a/pgbadger +++ b/pgbadger @@ -59,7 +59,7 @@ my $ver = ''; my @dbname = (); my @dbuser = (); my @dbclient = (); -my @dbclient2 = (); +my @dbclient2 = (); my @dbappname = (); my @exclude_user = (); my $ident = ''; @@ -1866,7 +1866,7 @@ div#littleToc a:hover { text-decoration:none; background-color:#DDDDDD; } -moz-box-shadow:3px 3px 6px 2px #A9A9A9; -webkit-box-shadow:3px 3px 6px #A9A9A9; } -#queriesbytype_graph, #lockbytype_graph, #databasesessions_graph, #usersessions_graph, #hostsessions_graph, #databaseconnections_graph, #userconnections_graph, #hostconnections_graph, #logstype_graph, #requestsdatabases_graph, #requestsapplications_graph { +#queriesbytype_graph, #lockbytype_graph, #databasesessions_graph, #usersessions_graph, #hostsessions_graph, #databaseconnections_graph, #userconnections_graph, #hostconnections_graph, #logstype_graph, #requestsdatabases_graph, #requestsapplications_graph #autovacuumbytable #autovacuumtuplesremoved { width : 500px; height: 250px; background:#F3F2ED; @@ -2693,7 +2693,31 @@ qq{Wrote buffersAddedRemovedRecycledWrit "", $total_idxscan, "", $total_tuples, "", $total_pages, "\n"; - print $fh "\n"; + print $fh "\n"; + if ($graph && $total_count) { + my %data = (); + foreach my $t (sort keys %{$autovacuum_info{tables}}) { + if ((($autovacuum_info{tables}{$t}{vacuums} * 100) / $total_count) > $pie_percentage_limit) { + $data{$t} = $autovacuum_info{tables}{$t}{vacuums} || 0; + } else { + $data{"Others"} += $autovacuum_info{tables}{$t}{vacuums} || 0; + } + } + &flotr2_piegraph(9, 'autovacuumbytable_graph', 'Autovacuum per table', %data); + %data = (); + if ($total_tuples) { + print $fh "
\n"; + foreach my $t (sort keys %{$autovacuum_info{tables}}) { + if ((($autovacuum_info{tables}{$t}{tuples}{removed} * 100) / $total_tuples) > $pie_percentage_limit) { + $data{$t} = $autovacuum_info{tables}{$t}{tuples}{removed} || 0; + } else { + $data{"Others"} += $autovacuum_info{tables}{$t}{tuples}{removed} || 0; + } + } + &flotr2_piegraph(9, 'autovacuumtuplesremoved_graph', 'Autovacuum tuples removed per table', %data); + } + } + print $fh "\n"; } # ANALYZE stats per table @@ -2702,7 +2726,7 @@ qq{Wrote buffersAddedRemovedRecycledWrit

ANALYZEs by table ^

- +
Table ANALYZEs