]> granicus.if.org Git - pgbadger/commitdiff
Fix display of empty hourly graph when no data were found.
authorDarold Gilles <gilles@darold.net>
Thu, 11 Oct 2012 20:25:56 +0000 (22:25 +0200)
committerDarold Gilles <gilles@darold.net>
Thu, 11 Oct 2012 20:25:56 +0000 (22:25 +0200)
pgbadger

index 97ab8e49e05e637e63019097985fd47808ab8eaf..3ef020f73202d7b60bc4dc98f842f6188e7bce0f 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -1119,7 +1119,7 @@ Average duration of sessions: $avg_session_duration
        if (!$disable_connection && $connection_info{count}) {
                print $fh "Total number of connections: $connection_info{count}\n";
        }
-       if (!$disable_hourly) {
+       if (!$disable_hourly && $overall_stat{'queries_number'}) {
                print $fh qq{
 
 - Hourly statistics ----------------------------------------------------
@@ -1653,7 +1653,7 @@ EOF
 <a href="#OverallStatsReport">Overall statistics</a> | 
 };
        if (!$error_only) {
-               if (!$disable_hourly) {
+               if (!$disable_hourly && $overall_stat{'queries_number'}) {
                        print $fh qq{<a href="#HourlyStatsReport">Hourly statistics</a> | };
                }
                if (!$disable_type && !$log_duration) {
@@ -1719,7 +1719,7 @@ sub html_footer
                        <li><a href="#top">^ Back to top</a></li><li><a href="#OverallStatsReport">Overall statistics</a></li>
 };
        if (!$error_only) {
-               if (!$disable_hourly) {
+               if (!$disable_hourly && $overall_stat{'queries_number'}) {
                        print $fh qq{<li><a href="#HourlyStatsReport">Hourly statistics</a></li>};
                }
                if (!$disable_type && !$log_duration) {
@@ -1863,7 +1863,7 @@ sub dump_as_html
 </div>
 };
 
-       if (!$disable_hourly) {
+       if (!$disable_hourly && $overall_stat{'queries_number'}) {
                print $fh qq{
 <h2 id="HourlyStatsReport">Hourly statistics <a href="#top" title="Back to top">^</a></h2>