]> granicus.if.org Git - pgbadger/commitdiff
Fix Illegal division by zero at line 3832. Thanks to MarcoTrek for the report.
authorDalibo <admin@dalibo.com>
Tue, 11 Nov 2014 12:12:34 +0000 (13:12 +0100)
committerDalibo <admin@dalibo.com>
Tue, 11 Nov 2014 12:12:34 +0000 (13:12 +0100)
pgbadger

index 8954e4f8f392aee5eeab0f3c42b6c1946c059f73..14f2265dd5989853dd3e5fd58a3c6345f4b84032 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -3829,8 +3829,8 @@ sub print_overall_statistics
                $query_peak_date = $_;
                last;
        }
-       my $avg_queries = &comma_numbers(int($overall_stat{'queries_number'}/$session_info{count}));
-       my $avg_duration = &convert_time(int($overall_stat{'queries_duration'}/$session_info{count}));
+       my $avg_queries = &comma_numbers(int($overall_stat{'queries_number'}/($session_info{count} || 1)));
+       my $avg_duration = &convert_time(int($overall_stat{'queries_duration'}/($session_info{count} || 1)));
        my $fmt_errors = &comma_numbers($overall_stat{'errors_number'});
        my $fmt_unique_error = &comma_numbers(scalar keys %error_info);
        my $autovacuum_count = &comma_numbers($autovacuum_info{count});