]> granicus.if.org Git - pgbadger/commitdiff
revert to single thread if file is small
authorbrunomgalmeida <brunomgalmeida@gmail.com>
Thu, 1 May 2014 14:49:06 +0000 (15:49 +0100)
committerbrunomgalmeida <brunomgalmeida@gmail.com>
Thu, 1 May 2014 14:49:06 +0000 (15:49 +0100)
print calendars 4+4+4 instead of 3+4+4+1 when looking at a full year

pgbadger

index 1e96f16c5723cc27d41f263cec8789e25cfcf95f..e92afc185a6268a17effc7878fc8c5e5efcd00e7 100644 (file)
--- a/pgbadger
+++ b/pgbadger
@@ -1225,8 +1225,8 @@ if (!$incremental) {
                closedir DIR;
                my $i = 1;
                foreach my $m (sort {$a <=> $b } @ymonths) {
-                       print $fh "</tr>\n<tr>\n" if ( ($i%4) == 0 );
                        print $fh "<td><span class=\"span3\">", &get_calendar($y, $m), "</span></td>\n";
+                       print $fh "</tr>\n<tr>\n" if ( ($i%4) == 0 );
                        $i++;
                }
                print $fh qq{
@@ -10227,7 +10227,11 @@ sub split_logfile
 
        # Real size of the file is unknown, try to find it
        # bz2 does not report real size
-       if ($logf =~ /\.(gz|zip)/i) {
+       if ($totalsize <= 16777216) { #16MB
+               #If the file is very small, many jobs actually make the parsing take longer
+               #What is an acceptable file size????
+               $queue_size = 0;
+       } elsif ($logf =~ /\.(gz|zip)/i) {
                $totalsize = 0;
                my $cmd_file_size = $gzip_uncompress_size;
                if ($logf =~ /\.zip/i) {