]> granicus.if.org Git - pgbadger/commitdiff
Add OTHERS type of queries lower than 2% to be include in the sum of types < 2%
authorDarold Gilles <gilles@darold.net>
Thu, 5 Jul 2012 11:35:13 +0000 (13:35 +0200)
committerDarold Gilles <gilles@darold.net>
Thu, 5 Jul 2012 11:35:13 +0000 (13:35 +0200)
pgbadger

index 09aa51e3cce911d4f427ed36fcfb8aa8b217605c..fbb82a060dd826c7f1c19e03b07b6bedd5c67bb0 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -1769,7 +1769,11 @@ sub dump_as_html
                                        $data{"Sum types < $pie_percentage_limit%"} += $overall_stat{$t} || 0;
                                }
                        }
-                       $data{'Others'} = $total - $totala;
+                       if ( ((($total - $totala)*100)/$total) > $pie_percentage_limit) {
+                               $data{'Others'} = $total - $totala;
+                       } else {
+                               $data{"Sum types < $pie_percentage_limit%"} += $total - $totala;
+                       }
                        &flotr2_piegraph(8, 'queriesbytype_graph','Type of queries', %data);
                }
                print $fh "</td></tr></table>\n";