]> granicus.if.org Git - pgbadger/commitdiff
Split temporary files report into two graphs (files size and number of file) to no...
authorDarold Gilles <gilles@darold.net>
Thu, 11 Jul 2013 14:03:10 +0000 (16:03 +0200)
committerDarold Gilles <gilles@darold.net>
Thu, 11 Jul 2013 14:03:10 +0000 (16:03 +0200)
pgbadger

index e69c59092a2747d355e879672dd27d5fe752457d..56b84973d83d789bffe4afc0302c5059f9d94ea8 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -2446,7 +2446,7 @@ div#littleToc a:hover { text-decoration:none; background-color:#DDDDDD; }
 .sql .nu0 {color: #cc66cc;}
 .sql span.xtra { display:block; }
 
-#queriespersecond_graph, #connectionspersecond_graph, #queriesduration_graph, #checkpointwritebuffers_graph, #checkpointfiles_graph, #restartpointwritebuffers_graph, #temporaryfile_graph, #autovacuum_graph, #selectqueries_graph, #writequeries_graph {
+#queriespersecond_graph, #connectionspersecond_graph, #queriesduration_graph, #checkpointwritebuffers_graph, #checkpointfiles_graph, #restartpointwritebuffers_graph, #temporarydata_graph, #temporaryfile_graph, #autovacuum_graph, #selectqueries_graph, #writequeries_graph {
        width : 1025px;
        height: 400px;
        background:#F3F2ED;
@@ -3296,13 +3296,22 @@ sub print_checkpoint_tempfile_vacuum_reports
                }
 
                # Temporary file size
-               if ($tempfile_info{count} && exists $graph_data{size}) {
+               if (exists $graph_data{size}) {
                        &flotr2_graph(
-                               $graphid++, 'temporaryfile_graph', $graph_data{size}, '', '', 'Temporary files (' . $avg_minutes . ' minutes period)',
-                               'Size of files', 'Size of files', '', '', 'Number of files', $graph_data{count}, 'Number of files'
+                               $graphid++, 'temporarydata_graph', $graph_data{size}, '', '', 'Size of temporary files (' . $avg_minutes . ' minutes period)',
+                               'Size of files', 'Size of files'
                        );
                }
 
+               # Temporary file number
+               if ($tempfile_info{count}) {
+                       &flotr2_graph(
+                               $graphid++, 'temporaryfile_graph', $graph_data{count}, '', '', 'Number of temporary files (' . $avg_minutes . ' minutes period)',
+                               'Number of files', 'Number of files'
+                       );
+               }
+
+
                # VACUUMs and ANALYZEs
                if ($autovacuum_info{count} || $autoanalyze_info{count}) {
                        if (exists $graph_data{vcount} || exists $graph_data{acount}) {
@@ -6125,15 +6134,12 @@ document.writeln('<table align="center"><tr><td><input type="button" class="dldB
         },
        mouse: {
             track: true,
-           trackFormatter: function(obj){ return dateTracker(obj) },
+           trackFormatter: function(obj){ return dateTracker(obj,'$type') },
             relative: true,
            sensibility: 5,
            trackDecimals: 2,
            lineColor: 'purple',
         },
-       crosshair:{
-            mode: 'xy'
-        },
         HtmlText: false,
     };
 
@@ -6888,10 +6894,10 @@ function sql_format (obj)
        }
 }
 
-function dateTracker(obj) 
+function dateTracker(obj, gtype
 {
        var dateToDisplay = new Date(parseInt(obj.x)); 
-       return dateToDisplay.toGMTString()+', '+obj.series.label+': '+obj.y;
+       return dateToDisplay.toGMTString()+', '+obj.series.label+': '+pretty_print_number(obj.y, gtype);
 }
 
 function pretty_print_number(val, type)