]> granicus.if.org Git - pgbadger/commitdiff
Rewrite reloading of last log time from binary files.
authorDarold Gilles <gilles@darold.net>
Thu, 30 Jan 2014 16:52:29 +0000 (17:52 +0100)
committerDarold Gilles <gilles@darold.net>
Thu, 30 Jan 2014 16:52:29 +0000 (17:52 +0100)
pgbadger

index 0bc2191a779abb6b9a6b8ae04dd2c3b582be41d9..d412da930a28bbc4fa4d4eeb9ff0eb19653356ee 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -7071,17 +7071,21 @@ sub load_stats
 
        $overall_stat{queries_number} += $_overall_stat{queries_number};
 
-       $overall_stat{'first_log_ts'} = $_overall_stat{'first_log_ts'}
-               if not $overall_stat{'first_log_ts'} || ( $_overall_stat{'first_log_ts'}
-                       && ($overall_stat{'first_log_ts'} gt $_overall_stat{'first_log_ts'}) );
+       if ($_overall_stat{'first_log_ts'}) {
+               $overall_stat{'first_log_ts'} = $_overall_stat{'first_log_ts'}
+                       if (!$overall_stat{'first_log_ts'} || 
+                               ($overall_stat{'first_log_ts'} gt $_overall_stat{'first_log_ts'}));
+       }
 
        $overall_stat{'last_log_ts'} = $_overall_stat{'last_log_ts'}
                if not $overall_stat{'last_log_ts'}
                        or $overall_stat{'last_log_ts'} lt $_overall_stat{'last_log_ts'};
 
-       $overall_stat{'first_query_ts'} = $_overall_stat{'first_query_ts'}
-               if not $overall_stat{'first_query_ts'} || ( $_overall_stat{'first_query_ts'}
-                       && ($overall_stat{'first_query_ts'} gt $_overall_stat{'first_query_ts'}) );
+       if ($_overall_stat{'first_query_ts'}) {
+               $overall_stat{'first_query_ts'} = $_overall_stat{'first_query_ts'}
+                       if (!$overall_stat{'first_query_ts'} ||
+                               ($overall_stat{'first_query_ts'} gt $_overall_stat{'first_query_ts'}));
+       }
 
        $overall_stat{'last_query_ts'} = $_overall_stat{'last_query_ts'}
                if not $overall_stat{'last_query_ts'}