]> granicus.if.org Git - pgbadger/commitdiff
editor config changes
authormadtibo <madtibo_git@tribu-ml.fr>
Wed, 23 Jan 2019 13:33:08 +0000 (14:33 +0100)
committermadtibo <madtibo_git@tribu-ml.fr>
Wed, 23 Jan 2019 13:33:08 +0000 (14:33 +0100)
pgbadger

index c8910ae5619a2089f2eaa26d5cbdaa2e84791041..dbc0330831b233616bc0aa0e1e194f7404cb6a62 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -709,7 +709,7 @@ elsif ($#outfiles == -1)
 {
        ($extension) ? push(@outfiles, 'out.' . $extension) : push(@outfiles, 'out.html');
        map { s/\.text/.txt/; } @outfiles;
-       
+
 }
 
 # Set the default extension and output format, load JSON Perl module if required
@@ -1212,7 +1212,7 @@ if ( $outdir && $retention && ($saved_last_line{datetime} || $pgb_saved_last_lin
                                }
                        }
                }
-               # Now removed the corresponding days 
+               # Now removed the corresponding days
                foreach my $y (sort { $a <=> $b } @dyears) {
                        unless(opendir(DIR, "$outdir/$y")) {
                                localdie("Error: can't opendir $outdir/$y: $!");
@@ -1320,7 +1320,7 @@ if ($incremental && !$remote_host)
                        # Auto detect log format for proper parsing
                        my $fmt = autodetect_format($f);
 
-                       # Set regex to parse the log file 
+                       # Set regex to parse the log file
                        $fmt = set_parser_regex($fmt);
 
                        if (($fmt ne 'pgbouncer') && ($saved_last_line{current_pos} > 0))
@@ -1607,7 +1607,7 @@ if ( !$incremental && ($#given_log_files >= 0) )
        &restore_log_type_count();
 
        foreach $outfile (@outfiles)
-       {       
+       {
                ($current_out_file, $extens) = &set_output_extension($outfile, $extension);
 
                $extens = $dft_extens if ($current_out_file eq '-' && $dft_extens);
@@ -1942,7 +1942,7 @@ reports:
 If you have a pg_dump at 23:00 and 13:00 each day during half an hour, you can
 use pgBadger as follow to exclude these period from the report:
 
-    pgbadger --exclude-time "2013-09-.* (23|13):.*" postgresql.log 
+    pgbadger --exclude-time "2013-09-.* (23|13):.*" postgresql.log
 
 This will help avoid having COPY statements, as generated by pg_dump, on top of
 the list of slowest queries. You can also use --exclude-appname "pg_dump" to
@@ -2379,7 +2379,7 @@ sub build_incremental_reports
           <span class="icon-bar"></span>
           <span class="icon-bar"></span>
         </button>
-       $pgbadger_logo 
+       $pgbadger_logo
        <div class="pull-right"> <a title="PostgreSQL Log Analyzer" href="" id="pgbadger-brand" class="navbar-brand" data-original-title="PostgreSQL Log Analyzer">$local_title</a></div>
        </div>
     </div>
@@ -3018,7 +3018,7 @@ sub process_file
                                print STDERR "reset CSV parser\n";
                                $csv->SetDiag(0);
                        } else {
-                               $cursize = $totalsize; 
+                               $cursize = $totalsize;
                        }
                }
        }
@@ -3486,7 +3486,7 @@ sub unescape_jsonlog
        while ($str =~ s/\\r\\n/\n/gs) {};
        while ($str =~ s/([^\\])\\r/$1\n/gs) {};
        while ($str =~ s/([^\\])\\n/$1\n/gs) {};
-       
+
        return $str;
 }
 
@@ -3571,7 +3571,7 @@ sub parse_orphan_line
                        if ($1 > $autovacuum_info{peak}{system_usage}{elapsed}) {
                                $autovacuum_info{peak}{system_usage}{elapsed} = $1;
                                $autovacuum_info{peak}{system_usage}{table} = $cur_info{$cur_pid}{vacuum};
-                               $autovacuum_info{peak}{system_usage}{date} = 
+                               $autovacuum_info{peak}{system_usage}{date} =
                                        "$cur_info{$cur_pid}{year}-$cur_info{$cur_pid}{month}-$cur_info{$cur_pid}{day} " .
                                        "$cur_info{$cur_pid}{hour}:$cur_info{$cur_pid}{min}:$cur_info{$cur_pid}{sec}";
                        }
@@ -3658,7 +3658,7 @@ sub check_file_changed
        if ($iscompressed) {
                close($lfile);
                return (1, "log file is compressed");
-               
+
        }
 
        my ($gsec, $gmin, $ghour, $gmday, $gmon, $gyear, $gwday, $gyday, $gisdst) = localtime(time);
@@ -3837,7 +3837,7 @@ sub check_incremental_position
                        my $bpath = $incr_date;
                        $bpath =~ s/\-/\//g;
 
-                       # Mark this directory as needing a reindex      
+                       # Mark this directory as needing a reindex
                        if (open(my $out, '>>' , "$last_parsed.tmp")) {
                                flock($out, 2) || return 1;
                                print $out "$incr_date\n";
@@ -3915,7 +3915,7 @@ sub normalize_query
        # Remove extra space, new line and tab characters by a single space
        $orig_query =~ s/\s+/ /gs;
 
-       # Removed start of transaction 
+       # Removed start of transaction
        if ($orig_query !~ /^\s*begin\s*;\s*$/) {
                $orig_query =~ s/^\s*begin\s*;\s*//gs
        }
@@ -4073,7 +4073,7 @@ sub convert_time
                $milliseconds =~ s/\.\d+//;
        }
        $milliseconds =~ s/^[0]+// if ($milliseconds !~ /\./);
-       
+
 
        $time = $days . $hours . $minutes . $seconds . $milliseconds;
        $time = '0ms' if ($time eq '');
@@ -4621,7 +4621,7 @@ Report not supported by text format
                                        print $fh "\t- Example $j: ", &convert_time($d), " - $db - ", $normalyzed_info{$k}{samples}{$d}{query}, "\n";
                                        $j++;
                                }
-                       }                             
+                       }
                        $idx++;
                }
                @top_temporary = ();
@@ -4681,7 +4681,7 @@ Report not supported by text format
                                        print $fh "\t- Example $j: ", &convert_time($d), " - $db - ", $normalyzed_info{$k}{samples}{$d}{query}, "\n";
                                        $j++;
                                }
-                       }                             
+                       }
                        $idx++;
                }
                @top_cancelled = ();
@@ -5235,7 +5235,7 @@ sub html_header
                                <li><a href="#checkpoints-buffers">Checkpoints buffers</a></li>
                                <li><a href="#checkpoints-files">Checkpoints files</a></li>
                                <li><a href="#checkpoints-distance">Checkpoints distance</a></li>
-                               <li><a href="#checkpoint-activity">Checkpoint activity</a></li> 
+                               <li><a href="#checkpoint-activity">Checkpoint activity</a></li>
                        </ul>
                </li>
 };
@@ -5302,7 +5302,7 @@ sub html_header
 };
                                }
                                print $fh qq{
-                       </ul>     
+                       </ul>
                </li>
 };
                        }
@@ -5330,7 +5330,7 @@ sub html_header
                                $sqlstate_report
                                <li class="divider"></li>
                                <li><a href="#most-frequent-errors-events">Most frequent errors/events</a></li>
-                       </ul>        
+                       </ul>
                </li>
 };
        }
@@ -5411,7 +5411,7 @@ sub html_footer
   <!-- Modal -->
   <div class="modal fade" id="pgbadgerModal">
     <div class="modal-dialog">
-    
+
       <!-- Modal content-->
       <div class="modal-content">
         <div class="modal-header">
@@ -5425,7 +5425,7 @@ sub html_footer
           <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
         </div>
       </div>
-      
+
     </div>
   </div>
 
@@ -5681,7 +5681,7 @@ sub print_general_activity
                                @{$all_query_duration{'WRITE'}}=  sort{ $a <=> $b } (@{$all_query_duration{'INSERT'}},@{$all_query_duration{'UPDATE'}},@{$all_query_duration{'DELETE'}},@{$all_query_duration{'COPY FROM'}});
                                $cur_period_info{'WRITE'}{$lp}{percentileindex} = int(@{$all_query_duration{'WRITE'}} * $lp / 100) ;
                                $cur_period_info{'WRITE'}{$lp}{percentile} = $all_query_duration{'WRITE'}[$cur_period_info{'WRITE'}{$lp}{percentileindex}];
-                               $percentile{'WRITE'}{$lp} =  &convert_time($cur_period_info{'WRITE'}{$lp}{percentile}); 
+                               $percentile{'WRITE'}{$lp} =  &convert_time($cur_period_info{'WRITE'}{$lp}{percentile});
                        }
                        $queries .= qq{
                                        <tr>
@@ -5806,7 +5806,7 @@ sub print_general_activity
                                        </thead>
                                        <tbody>$queries
                                        </tbody>
-                               </table>                                                                                                
+                               </table>
                        </div>
                        <div class="tab-pane" id="general-activity-select-queries">
                                <table class="table table-striped table-hover table-condensed">
@@ -5824,7 +5824,7 @@ sub print_general_activity
                                        </thead>
                                        <tbody>$select_queries
                                        </tbody>
-                               </table>                                                
+                               </table>
                        </div>
                        <div class="tab-pane" id="general-activity-write-queries">
                                <table class="table table-striped table-hover table-condensed">
@@ -5844,7 +5844,7 @@ sub print_general_activity
                                        </thead>
                                        <tbody>$write_queries
                                        </tbody>
-                               </table>        
+                               </table>
                        </div>
                        <div class="tab-pane" id="general-activity-prepared-queries">
                                <table class="table table-striped table-hover table-condensed">
@@ -5860,7 +5860,7 @@ sub print_general_activity
                                        </thead>
                                        <tbody>$prepared_queries
                                        </tbody>
-                               </table>        
+                               </table>
                        </div>
                        <div class="tab-pane" id="general-activity-connections">
                                <table class="table table-striped table-hover table-condensed">
@@ -5874,7 +5874,7 @@ sub print_general_activity
                                        </thead>
                                        <tbody>$connections
                                        </tbody>
-                               </table>        
+                               </table>
                        </div>
                        <div class="tab-pane" id="general-activity-sessions">
                                <table class="table table-striped table-hover table-condensed">
@@ -5888,7 +5888,7 @@ sub print_general_activity
                                        </thead>
                                        <tbody>$sessions
                                        </tbody>
-                               </table>        
+                               </table>
                        </div>
                </div> <!-- end of div tab-content -->
                <span class="pull-right">&uarr; <small><a href="#general-activity" class="">Back to the top of the <em>General Activity</em> table</a></small></span>
@@ -5940,7 +5940,7 @@ sub print_sql_traffic
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$query_peak queries/s</span> <span class="figure-label">Query Peak</span></li>
-                                       <li><span class="figure">$query_peak_date</span> <span class="figure-label">Date</span></li>    
+                                       <li><span class="figure">$query_peak_date</span> <span class="figure-label">Date</span></li>
                                </ul>
                        </div>
                </div>
@@ -5959,7 +5959,7 @@ $drawn_graphs{queriespersecond_graph}
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$select_peak queries/s</span> <span class="figure-label">Query Peak</span></li>
-                                       <li><span class="figure">$select_peak_date</span> <span class="figure-label">Date</span></li>    
+                                       <li><span class="figure">$select_peak_date</span> <span class="figure-label">Date</span></li>
                                </ul>
                        </div>
                </div>
@@ -5978,7 +5978,7 @@ $drawn_graphs{selectqueries_graph}
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$write_peak queries/s</span> <span class="figure-label">Query Peak</span></li>
-                                       <li><span class="figure">$write_peak_date</span> <span class="figure-label">Date</span></li>    
+                                       <li><span class="figure">$write_peak_date</span> <span class="figure-label">Date</span></li>
                                </ul>
                        </div>
                </div>
@@ -6071,7 +6071,7 @@ sub print_pgbouncer_stats
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$request_peak queries/s</span> <span class="figure-label">Request Peak</span></li>
-                                       <li><span class="figure">$request_peak_date</span> <span class="figure-label">Date</span></li>    
+                                       <li><span class="figure">$request_peak_date</span> <span class="figure-label">Date</span></li>
                                </ul>
                        </div>
                </div>
@@ -6090,9 +6090,9 @@ $drawn_graphs{pgb_requestpersecond_graph}
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$inbytes_peak Bytes/s</span> <span class="figure-label">In Bytes Peak</span></li>
-                                       <li><span class="figure">$inbytes_peak_date</span> <span class="figure-label">Date</span></li>    
+                                       <li><span class="figure">$inbytes_peak_date</span> <span class="figure-label">Date</span></li>
                                        <li><span class="figure">$outbytes_peak Bytes/s</span> <span class="figure-label">Out Bytes Peak</span></li>
-                                       <li><span class="figure">$outbytes_peak_date</span> <span class="figure-label">Date</span></li>    
+                                       <li><span class="figure">$outbytes_peak_date</span> <span class="figure-label">Date</span></li>
                                </ul>
                        </div>
                </div>
@@ -6111,7 +6111,7 @@ $drawn_graphs{pgb_bytepersecond_graph}
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$avgduration_peak</span> <span class="figure-label">Average Duration Peak</span></li>
-                                       <li><span class="figure">$avgduration_peak_date</span> <span class="figure-label">Date</span></li>    
+                                       <li><span class="figure">$avgduration_peak_date</span> <span class="figure-label">Date</span></li>
                                </ul>
                        </div>
                </div>
@@ -6263,7 +6263,7 @@ sub compute_query_graphs
                                                # Average duration per minute
                                                $graph_data{query4} .= "[$t, " . sprintf("%.3f", ($q_dataavg{duration}{"$rd"} || 0) / ($q_dataavg{count}{"$rd"} || 1)) . "],";
                                        }
-                                       if (scalar keys %c_dataavg) { 
+                                       if (scalar keys %c_dataavg) {
                                                # Average connections per minute
                                                $graph_data{conn_avg} .= "[$t, " . int(($c_dataavg{average}{"$rd"} || 0) / (60 * $avg_minutes)) . "],";
                                                # Max connections per minute
@@ -6272,7 +6272,7 @@ sub compute_query_graphs
                                                # Min connections per minute
                                                $graph_data{conn_min} .= "[$t, " . ($c_dataavg{min}{"$rd"} || 0) . "],";
                                        }
-                                       if (scalar keys %s_dataavg) { 
+                                       if (scalar keys %s_dataavg) {
                                                # Average connections per minute
                                                $graph_data{sess_avg} .= "[$t, " . int(($s_dataavg{average}{"$rd"} || 0) / (60 * $avg_minutes)) . "],";
                                                # Max connections per minute
@@ -6281,7 +6281,7 @@ sub compute_query_graphs
                                                # Min connections per minute
                                                $graph_data{sess_min} .= "[$t, " . ($s_dataavg{min}{"$rd"} || 0) . "],";
                                        }
-                                       if (!$disable_query && (scalar keys %a_dataavg > 0)) { 
+                                       if (!$disable_query && (scalar keys %a_dataavg > 0)) {
                                                foreach my $action (@SQL_ACTION) {
                                                        next if ($select_only && ($action ne 'SELECT'));
 
@@ -6300,7 +6300,7 @@ sub compute_query_graphs
                                                        }
                                                }
                                        }
-                                       if (!$disable_query && (scalar keys %p_dataavg> 0)) { 
+                                       if (!$disable_query && (scalar keys %p_dataavg> 0)) {
                                                $graph_data{prepare} .= "[$t, " . ($p_dataavg{prepare}{"$rd"} || 0) . "],";
                                                $graph_data{execute} .= "[$t, " . ($p_dataavg{execute}{"$rd"} || 0) . "],";
                                                $graph_data{ratio_bind_prepare} .= "[$t, " . sprintf("%.2f", ($p_dataavg{execute}{"$rd"} || 0) / ($p_dataavg{prepare}{"$rd"} || 1)) . "],";
@@ -6426,7 +6426,7 @@ sub compute_pgbouncer_graphs
                                        next if ($t < $t_min);
                                        last if ($t > $t_max);
 
-                                       if (scalar keys %c_dataavg) { 
+                                       if (scalar keys %c_dataavg) {
                                                # Average connections per minute
                                                $graph_data{conn_avg} .= "[$t, " . int(($c_dataavg{average}{"$rd"} || 0) / (60 * $avg_minutes)) . "],";
                                                # Max connections per minute
@@ -6435,7 +6435,7 @@ sub compute_pgbouncer_graphs
                                                # Min connections per minute
                                                $graph_data{conn_min} .= "[$t, " . ($c_dataavg{min}{"$rd"} || 0) . "],";
                                        }
-                                       if (scalar keys %s_dataavg) { 
+                                       if (scalar keys %s_dataavg) {
                                                # Average connections per minute
                                                $graph_data{sess_avg} .= "[$t, " . int(($s_dataavg{average}{"$rd"} || 0) / (60 * $avg_minutes)) . "],";
                                                # Max connections per minute
@@ -6489,7 +6489,7 @@ sub print_established_connection
                <div class="well key-figures">
                        <ul>
                                <li><span class="figure">$connection_peak connections</span> <span class="figure-label">Connection Peak</span></li>
-                               <li><span class="figure">$connection_peak_date</span> <span class="figure-label">Date</span></li>    
+                               <li><span class="figure">$connection_peak_date</span> <span class="figure-label">Date</span></li>
                        </ul>
                </div>
        </div>
@@ -6521,7 +6521,7 @@ sub print_established_pgb_connection
                <div class="well key-figures">
                        <ul>
                                <li><span class="figure">$connection_peak connections</span> <span class="figure-label">Connection Peak</span></li>
-                               <li><span class="figure">$connection_peak_date</span> <span class="figure-label">Date</span></li>    
+                               <li><span class="figure">$connection_peak_date</span> <span class="figure-label">Date</span></li>
                        </ul>
                </div>
        </div>
@@ -6576,7 +6576,7 @@ sub print_user_connection
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_user[0]</span> <span class="figure-label">Main User</span></li>
-                                       <li><span class="figure">$total_count connections</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count connections</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -6601,7 +6601,7 @@ sub print_user_connection
                                                        <tbody>
                                                        $conn_user_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -6653,7 +6653,7 @@ sub print_user_pgb_connection
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_user[0]</span> <span class="figure-label">Main User</span></li>
-                                       <li><span class="figure">$total_count connections</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count connections</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -6678,7 +6678,7 @@ sub print_user_pgb_connection
                                                        <tbody>
                                                        $conn_user_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -6729,7 +6729,7 @@ sub print_host_connection
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_host[0]</span> <span class="figure-label">Main host with $main_host[1] connections</span></li>
-                                       <li><span class="figure">$total_count</span> <span class="figure-label">Total connections</span></li>    
+                                       <li><span class="figure">$total_count</span> <span class="figure-label">Total connections</span></li>
                                </ul>
                        </div>
                </div>
@@ -6754,7 +6754,7 @@ sub print_host_connection
                                                        <tbody>
                                                        $conn_host_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -6806,7 +6806,7 @@ sub print_host_pgb_connection
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_host[0]</span> <span class="figure-label">Main host with $main_host[1] connections</span></li>
-                                       <li><span class="figure">$total_count</span> <span class="figure-label">Total connections</span></li>    
+                                       <li><span class="figure">$total_count</span> <span class="figure-label">Total connections</span></li>
                                </ul>
                        </div>
                </div>
@@ -6831,7 +6831,7 @@ sub print_host_pgb_connection
                                                        <tbody>
                                                        $conn_host_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -6887,7 +6887,7 @@ sub print_database_connection
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_database[0]</span> <span class="figure-label">Main Database</span></li>
-                                       <li><span class="figure">$total_count connections</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count connections</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -6913,7 +6913,7 @@ sub print_database_connection
                                                        <tbody>
                                                        $conn_database_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -6968,7 +6968,7 @@ sub print_database_pgb_connection
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_database[0]</span> <span class="figure-label">Main Database</span></li>
-                                       <li><span class="figure">$total_count connections</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count connections</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -6994,7 +6994,7 @@ sub print_database_pgb_connection
                                                        <tbody>
                                                        $conn_database_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -7023,7 +7023,7 @@ sub print_simultaneous_session
                <div class="well key-figures">
                        <ul>
                                <li><span class="figure">$session_peak sessions</span> <span class="figure-label">Session Peak</span></li>
-                               <li><span class="figure">$session_peak_date</span> <span class="figure-label">Date</span></li>    
+                               <li><span class="figure">$session_peak_date</span> <span class="figure-label">Date</span></li>
                        </ul>
                </div>
        </div>
@@ -7055,7 +7055,7 @@ sub print_simultaneous_pgb_session
                <div class="well key-figures">
                        <ul>
                                <li><span class="figure">$session_peak sessions</span> <span class="figure-label">Session Peak</span></li>
-                               <li><span class="figure">$session_peak_date</span> <span class="figure-label">Date</span></li>    
+                               <li><span class="figure">$session_peak_date</span> <span class="figure-label">Date</span></li>
                        </ul>
                </div>
        </div>
@@ -7134,7 +7134,7 @@ sub print_histogram_session_times
                                                        <tbody>
                                                        $histogram_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -7209,7 +7209,7 @@ sub print_histogram_pgb_session_times
                                                        <tbody>
                                                        $histogram_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -7263,7 +7263,7 @@ sub print_user_session
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_user[0]</span> <span class="figure-label">Main User</span></li>
-                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -7290,7 +7290,7 @@ sub print_user_session
                                                        <tbody>
                                                        $sess_user_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -7344,7 +7344,7 @@ sub print_user_pgb_session
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_user[0]</span> <span class="figure-label">Main User</span></li>
-                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -7371,7 +7371,7 @@ sub print_user_pgb_session
                                                        <tbody>
                                                        $sess_user_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -7425,7 +7425,7 @@ sub print_host_session
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_host[0]</span> <span class="figure-label">Main Host</span></li>
-                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -7452,7 +7452,7 @@ sub print_host_session
                                                        <tbody>
                                                        $sess_host_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -7507,7 +7507,7 @@ sub print_host_pgb_session
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_host[0]</span> <span class="figure-label">Main Host</span></li>
-                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -7534,7 +7534,7 @@ sub print_host_pgb_session
                                                        <tbody>
                                                        $sess_host_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -7589,7 +7589,7 @@ sub print_app_session
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_app[0]</span> <span class="figure-label">Main Host</span></li>
-                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -7616,7 +7616,7 @@ sub print_app_session
                                                        <tbody>
                                                        $sess_app_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -7671,7 +7671,7 @@ sub print_database_session
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_database[0]</span> <span class="figure-label">Main Database</span></li>
-                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -7699,7 +7699,7 @@ sub print_database_session
                                                        <tbody>
                                                        $sess_database_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -7753,7 +7753,7 @@ sub print_database_pgb_session
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_database[0]</span> <span class="figure-label">Main Database</span></li>
-                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count sessions</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -7781,7 +7781,7 @@ sub print_database_pgb_session
                                                        <tbody>
                                                        $sess_database_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -7862,7 +7862,7 @@ sub print_checkpoint
                }
        }
        # Checkpoint buffers and files
-       $drawn_graphs{checkpointwritebuffers_graph} = 
+       $drawn_graphs{checkpointwritebuffers_graph} =
                &jqplot_linegraph($graphid++, 'checkpointwritebuffers_graph', $graph_data{wbuffer}, '', '',
                                'Checkpoint write buffers (' . $avg_minutes . ' minutes period)',
                                'Buffers', 'Write buffers', '',  ''
@@ -7911,7 +7911,7 @@ sub print_checkpoint
                <div class="well key-figures">
                        <ul>
                                <li><span class="figure">$checkpoint_wbuffer_peak buffers</span> <span class="figure-label">Checkpoint Peak</span></li>
-                               <li><span class="figure">$checkpoint_wbuffer_peak_date</span> <span class="figure-label">Date</span></li>    
+                               <li><span class="figure">$checkpoint_wbuffer_peak_date</span> <span class="figure-label">Date</span></li>
                                <li><span class="figure">$overall_checkpoint{checkpoint_write} seconds</span> <span class="figure-label">Highest write time</span></li>
                                <li><span class="figure">$overall_checkpoint{checkpoint_sync} seconds</span> <span class="figure-label">Sync time</span></li>
                        </ul>
@@ -7951,7 +7951,7 @@ $drawn_graphs{checkpointfiles_graph}
                <div class="well key-figures">
                        <ul>
                        <li><span class="figure">$checkpoint_distance_peak Mo</span> <span class="figure-label">Distance Peak</span></li>
-                       <li><span class="figure">$checkpoint_distance_peak_date</span> <span class="figure-label">Date</span></li>    
+                       <li><span class="figure">$checkpoint_distance_peak_date</span> <span class="figure-label">Date</span></li>
                        </ul>
                </div>
        </div>
@@ -8070,7 +8070,7 @@ $drawn_graphs{checkpointdistance_graph}
                                        </thead>
                                        <tbody>$buffers
                                        </tbody>
-                               </table>                                                                                                
+                               </table>
                        </div>
                        <div class="tab-pane" id="checkpoint-activity-files">
                                <table class="table table-striped table-hover table-condensed">
@@ -8088,7 +8088,7 @@ $drawn_graphs{checkpointdistance_graph}
                                        </thead>
                                        <tbody>$files
                                        </tbody>
-                               </table>                                                
+                               </table>
                        </div>
                        <div class="tab-pane" id="checkpoint-activity-warnings">
                                <table class="table table-striped table-hover table-condensed">
@@ -8102,7 +8102,7 @@ $drawn_graphs{checkpointdistance_graph}
                                        </thead>
                                        <tbody>$warnings
                                        </tbody>
-                               </table>        
+                               </table>
                        </div>
                        <div class="tab-pane" id="checkpoint-activity-distance">
                                <table class="table table-striped table-hover table-condensed">
@@ -8116,8 +8116,8 @@ $drawn_graphs{checkpointdistance_graph}
                                        </thead>
                                        <tbody>$distance
                                        </tbody>
-                               </table>        
-                       </div>        
+                               </table>
+                       </div>
                </div> <!-- end of div tab-content -->
                <span class="pull-right">&uarr; <small><a href="#checkpoint-activity" class="">Back to the top of the <em>Checkpoint Activity</em> table</a></small></span>
        </div>
@@ -8430,7 +8430,7 @@ sub print_analyze_per_table
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_analyze[0] ($main_analyze[1])</span> <span class="figure-label">Main table analyzed (database $database)</span></li>
-                                       <li><span class="figure">$total_count analyzes</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count analyzes</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -8455,7 +8455,7 @@ sub print_analyze_per_table
                                                        <tbody>
                                                        $analyze_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -8687,7 +8687,7 @@ sub print_vacuum_per_table
                        <div class="well key-figures">
                                <ul>
                                        <li><span class="figure">$main_vacuum[0] ($main_vacuum[1])</span> <span class="figure-label">Main table vacuumed on database $database</span></li>
-                                       <li><span class="figure">$total_count vacuums</span> <span class="figure-label">Total</span></li>    
+                                       <li><span class="figure">$total_count vacuums</span> <span class="figure-label">Total</span></li>
                                </ul>
                        </div>
                </div>
@@ -8713,7 +8713,7 @@ sub print_vacuum_per_table
                                                        <tbody>
                                                        $vacuum_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -8808,7 +8808,7 @@ sub print_vacuum_tuple_removed
                                                        <tbody>
                                                        $vacuum_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -8904,7 +8904,7 @@ sub print_vacuum_page_removed
                                                        <tbody>
                                                        $vacuum_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -9002,7 +9002,7 @@ sub print_lock_type
                                                        <tbody>
                                                        $locktype_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -9093,7 +9093,7 @@ sub print_query_type
                                                        <tbody>
                                                        $querytype_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -9190,7 +9190,7 @@ sub print_query_per_database
                                                        <tbody>
                                                        $query_database_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -9284,7 +9284,7 @@ sub print_query_per_application
                                                        <tbody>
                                                        $query_application_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -9339,7 +9339,7 @@ sub print_query_per_user
                                $infos{duration}{$d} = $user_info{$d}{duration} || 0;
                        } else {
                                $infos{duration}{"Sum duration per users < $pie_percentage_limit%"} += $user_info{$d}{duration} || 0;
-                               push(@{$small{duration}}, $d);                          
+                               push(@{$small{duration}}, $d);
                        }
                }
                if ($#{$small{queries}} == 0) {
@@ -9348,7 +9348,7 @@ sub print_query_per_user
                }
                if ($#{$small{duration}} == 0){
                        $infos{duration}{$small{duration}[0]} = $infos{duration}{"Sum duration per users < $pie_percentage_limit%"};
-                       delete $infos{duration}{"Sum duration per users < $pie_percentage_limit%"};                     
+                       delete $infos{duration}{"Sum duration per users < $pie_percentage_limit%"};
                }
        }
        $drawn_graphs{queriesbyuser_graph} = &jqplot_piegraph($graphid++, 'graph_queriesbyuser', 'Queries per user', %{$infos{queries}});
@@ -9392,7 +9392,7 @@ sub print_query_per_user
                                                        <tbody>
                                                        $query_user_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -9435,7 +9435,7 @@ sub print_query_per_user
                                                        <tbody>
                                                        $query_user_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -9531,7 +9531,7 @@ sub print_query_per_host
                                                        <tbody>
                                                        $query_host_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -9796,7 +9796,7 @@ sub print_tempfile_report
                                        print $fh qq{
                                                <dt>
                                                <div id="query-c-$rank-$idx" class="sql sql-largesize"><i class="glyphicon icon-copy" title="Click to select query"></i>$query</div>$md5
-                                               
+
                                                </dt>
                                                <pre>$details</pre>
 };
@@ -9811,7 +9811,7 @@ sub print_tempfile_report
                        </td>
                </tr>
 };
-                       }                             
+                       }
                        $rank++;
                }
         print $fh qq{
@@ -9940,7 +9940,7 @@ sub print_cancelled_report
                                        print $fh qq{
                                                <dt>
                                                <div id="query-d-$rank-$idx" class="sql sql-largesize"><i class="glyphicon icon-copy" title="Click to select query"></i>$query</div>$md5
-                                               
+
                                                </dt>
                                                <pre>$details</pre>
 };
@@ -9955,7 +9955,7 @@ sub print_cancelled_report
                        </td>
                </tr>
 };
-                       }                             
+                       }
                        $rank++;
                }
         print $fh qq{
@@ -10089,7 +10089,7 @@ sub print_histogram_query_times
                                                        <tbody>
                                                        $histogram_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -10256,7 +10256,7 @@ sub print_time_consuming
                if (scalar keys %{$normalyzed_info{$k}{apps}} > 0) {
                        $apps_involved = qq{<button type="button" class="btn btn-default btn-xs" data-toggle="collapse" data-target="#time-consuming-queries-app-involved-rank-$rank">App(s) involved</button>};
                }
-               my $query_histo = 
+               my $query_histo =
                &jqplot_histograph($graphid++, 'time_consuming_queries_details_'.$rank, $graph_data{count}, $graph_data{duration}, 'Queries', 'Avg. duration');
 
                print $fh qq{
@@ -11322,7 +11322,7 @@ sub print_log_level
                                                        <tbody>
                                                        $logtype_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -11433,7 +11433,7 @@ sub print_error_code
                                                        <tbody>
                                                        $errorclass_info
                                                        </tbody>
-                                               </table>    
+                                               </table>
                                        </div>
                                </div>
                        </div>
@@ -11466,9 +11466,9 @@ sub show_error_as_html
                                <div class="well key-figures">
                                        <ul>
                                                <li><span class="figure">$main_error</span> <span class="figure-label">Max number of times the same event was reported</span></li>
-                                               <li><span class="figure">$total</span> <span class="figure-label">Total events found</span></li>    
+                                               <li><span class="figure">$total</span> <span class="figure-label">Total events found</span></li>
                                        </ul>
-                               </div>            
+                               </div>
                        </div>
                        <div class="col-md-9">
                                <table class="table table-striped" id="most-frequent-errors-events-table">
@@ -11573,7 +11573,7 @@ sub show_error_as_html
                                                </div><!-- end of details collapse -->
 };
                print $fh qq{
-<p><button type="button" class="btn btn-default btn-xs" data-toggle="collapse" data-target="#most-frequent-errors-events-examples-rank-$rank">Examples</button></p>                                                       
+<p><button type="button" class="btn btn-default btn-xs" data-toggle="collapse" data-target="#most-frequent-errors-events-examples-rank-$rank">Examples</button></p>
 } if (($sample > 0) && ($#{$error_info{$k}{date}} >= 0));
                print $fh qq{
                                                <!-- Examples collapse -->
@@ -11657,9 +11657,9 @@ sub show_pgb_error_as_html
                                <div class="well key-figures">
                                        <ul>
                                                <li><span class="figure">$main_error</span> <span class="figure-label">Max number of times the same event was reported</span></li>
-                                               <li><span class="figure">$total</span> <span class="figure-label">Total events found</span></li>    
+                                               <li><span class="figure">$total</span> <span class="figure-label">Total events found</span></li>
                                        </ul>
-                               </div>            
+                               </div>
                        </div>
                        <div class="col-md-9">
                                <table class="table table-striped" id="pgbmost-frequent-errors-events-table">
@@ -11761,7 +11761,7 @@ sub show_pgb_error_as_html
                                                </div><!-- end of details collapse -->
 };
                print $fh qq{
-<p><button type="button" class="btn btn-default btn-xs" data-toggle="collapse" data-target="#pgbmost-frequent-errors-events-examples-rank-$rank">Examples</button></p>                                                    
+<p><button type="button" class="btn btn-default btn-xs" data-toggle="collapse" data-target="#pgbmost-frequent-errors-events-examples-rank-$rank">Examples</button></p>
 } if (($sample > 0) && ($#{$pgb_error_info{$k}{date}} >= 0));
                print $fh qq{
                                                <!-- Examples collapse -->
@@ -11829,9 +11829,9 @@ sub show_pgb_reserved_pool
                                        <ul>
                                                <li><span class="figure">$main_pool</span> <span class="figure-label">Most used reserved pool</span></li>
                                                <li><span class="figure">$main_pool_val</span> <span class="figure-label">Time used</span></li>
-                                               <li><span class="figure">$total</span> <span class="figure-label">Total time reserved pools was used</span></li>    
+                                               <li><span class="figure">$total</span> <span class="figure-label">Total time reserved pools was used</span></li>
                                        </ul>
-                               </div>            
+                               </div>
                        </div>
                        <div class="col-md-9">
                                <table class="table table-striped" id="pgbmost-used-reserved-pool-table">
@@ -11984,7 +11984,7 @@ sub load_stats
 
        if ($_overall_stat{'first_log_ts'}) {
                $overall_stat{'first_log_ts'} = $_overall_stat{'first_log_ts'}
-                       if (!$overall_stat{'first_log_ts'} || 
+                       if (!$overall_stat{'first_log_ts'} ||
                                ($overall_stat{'first_log_ts'} gt $_overall_stat{'first_log_ts'}));
        }
 
@@ -11999,7 +11999,7 @@ sub load_stats
        }
 
        $overall_stat{'last_query_ts'} = $_overall_stat{'last_query_ts'}
-               if not $overall_stat{'last_query_ts'} 
+               if not $overall_stat{'last_query_ts'}
                        or $overall_stat{'last_query_ts'} lt $_overall_stat{'last_query_ts'};
 
        $overall_stat{errors_number} += $_overall_stat{errors_number};
@@ -12211,13 +12211,13 @@ sub load_stats
                        }
                }
                for (my $i = 0; $i <= $#{$_error_info{$q}{date}}; $i++) {
-                       &set_top_error_sample(  $q, 
-                                                                       $_error_info{$q}{date}[$i], 
+                       &set_top_error_sample(  $q,
+                                                                       $_error_info{$q}{date}[$i],
                                                                        $_error_info{$q}{error}[$i],
-                                                                       $_error_info{$q}{detail}[$i], 
-                                                                       $_error_info{$q}{context}[$i], 
+                                                                       $_error_info{$q}{detail}[$i],
+                                                                       $_error_info{$q}{context}[$i],
                                                                        $_error_info{$q}{statement}[$i],
-                                                                       $_error_info{$q}{hint}[$i], 
+                                                                       $_error_info{$q}{hint}[$i],
                                                                        $_error_info{$q}{db}[$i],
                                                                        $_error_info{$q}{user}[$i],
                                                                        $_error_info{$q}{app}[$i],
@@ -12240,8 +12240,8 @@ sub load_stats
                        }
                }
                for (my $i = 0; $i <= $#{$_pgb_error_info{$q}{date}}; $i++) {
-                       &pgb_set_top_error_sample(      $q, 
-                                                                       $_pgb_error_info{$q}{date}[$i], 
+                       &pgb_set_top_error_sample(      $q,
+                                                                       $_pgb_error_info{$q}{date}[$i],
                                                                        $_pgb_error_info{$q}{error}[$i],
                                                                        $_pgb_error_info{$q}{db}[$i],
                                                                        $_pgb_error_info{$q}{user}[$i],
@@ -12349,13 +12349,13 @@ sub load_stats
                                        ($_pgb_per_minute_info{$day}{$hour}{$min}{connection}{count} || 0);
                                $pgb_per_minute_info{$day}{$hour}{$min}{session}{count} +=
                                        ($_pgb_per_minute_info{$day}{$hour}{$min}{session}{count} || 0);
-                               $pgb_per_minute_info{$day}{$hour}{$min}{t_req} += 
+                               $pgb_per_minute_info{$day}{$hour}{$min}{t_req} +=
                                        ($_pgb_per_minute_info{$day}{$hour}{$min}{t_req} || 0);
-                               $pgb_per_minute_info{$day}{$hour}{$min}{t_inbytes} += 
+                               $pgb_per_minute_info{$day}{$hour}{$min}{t_inbytes} +=
                                        ($_pgb_per_minute_info{$day}{$hour}{$min}{t_inbytes} || 0);
-                               $pgb_per_minute_info{$day}{$hour}{$min}{t_outbytes} += 
+                               $pgb_per_minute_info{$day}{$hour}{$min}{t_outbytes} +=
                                        ($_pgb_per_minute_info{$day}{$hour}{$min}{t_outbytes} || 0);
-                               $pgb_per_minute_info{$day}{$hour}{$min}{t_avgduration} += 
+                               $pgb_per_minute_info{$day}{$hour}{$min}{t_avgduration} +=
                                        ($_pgb_per_minute_info{$day}{$hour}{$min}{t_avgduration} || 0);
                        }
                }
@@ -12409,10 +12409,10 @@ sub load_stats
                $normalyzed_info{$stmt}{count} += $_normalyzed_info{$stmt}{count};
 
                # Set min / max duration for this query
-               if (!exists $normalyzed_info{$stmt}{min} || ($normalyzed_info{$stmt}{min} > $_normalyzed_info{$stmt}{min})) { 
+               if (!exists $normalyzed_info{$stmt}{min} || ($normalyzed_info{$stmt}{min} > $_normalyzed_info{$stmt}{min})) {
                        $normalyzed_info{$stmt}{min} = $_normalyzed_info{$stmt}{min};
                }
-               if (!exists $normalyzed_info{$stmt}{max} || ($normalyzed_info{$stmt}{max} < $_normalyzed_info{$stmt}{max})) { 
+               if (!exists $normalyzed_info{$stmt}{max} || ($normalyzed_info{$stmt}{max} < $_normalyzed_info{$stmt}{max})) {
                        $normalyzed_info{$stmt}{max} = $_normalyzed_info{$stmt}{max};
                }
 
@@ -12438,10 +12438,10 @@ sub load_stats
                if (exists $_normalyzed_info{$stmt}{locks}) {
                        $normalyzed_info{$stmt}{locks}{count} += $_normalyzed_info{$stmt}{locks}{count};
                        $normalyzed_info{$stmt}{locks}{wait} += $_normalyzed_info{$stmt}{locks}{wait};
-                       if (!exists $normalyzed_info{$stmt}{locks}{minwait} || ($normalyzed_info{$stmt}{locks}{minwait} > $_normalyzed_info{$stmt}{locks}{minwait})) { 
+                       if (!exists $normalyzed_info{$stmt}{locks}{minwait} || ($normalyzed_info{$stmt}{locks}{minwait} > $_normalyzed_info{$stmt}{locks}{minwait})) {
                                $normalyzed_info{$stmt}{locks}{minwait} = $_normalyzed_info{$stmt}{locks}{minwait};
                        }
-                       if (!exists $normalyzed_info{$stmt}{locks}{maxwait} || ($normalyzed_info{$stmt}{locks}{maxwait} < $_normalyzed_info{$stmt}{locks}{maxwait})) { 
+                       if (!exists $normalyzed_info{$stmt}{locks}{maxwait} || ($normalyzed_info{$stmt}{locks}{maxwait} < $_normalyzed_info{$stmt}{locks}{maxwait})) {
                                $normalyzed_info{$stmt}{locks}{maxwait} = $_normalyzed_info{$stmt}{locks}{maxwait};
                        }
                }
@@ -12449,10 +12449,10 @@ sub load_stats
                if (exists $_normalyzed_info{$stmt}{tempfiles}) {
                        $normalyzed_info{$stmt}{tempfiles}{count} += $_normalyzed_info{$stmt}{tempfiles}{count};
                        $normalyzed_info{$stmt}{tempfiles}{size} += $_normalyzed_info{$stmt}{tempfiles}{size};
-                       if (!exists $normalyzed_info{$stmt}{tempfiles}{minsize} || ($normalyzed_info{$stmt}{tempfiles}{minsize} > $_normalyzed_info{$stmt}{tempfiles}{minsize})) { 
+                       if (!exists $normalyzed_info{$stmt}{tempfiles}{minsize} || ($normalyzed_info{$stmt}{tempfiles}{minsize} > $_normalyzed_info{$stmt}{tempfiles}{minsize})) {
                                $normalyzed_info{$stmt}{tempfiles}{minsize} = $_normalyzed_info{$stmt}{tempfiles}{minsize};
                        }
-                       if (!exists $normalyzed_info{$stmt}{tempfiles}{maxsize} || ($normalyzed_info{$stmt}{tempfiles}{maxsize} < $_normalyzed_info{$stmt}{tempfiles}{maxsize})) { 
+                       if (!exists $normalyzed_info{$stmt}{tempfiles}{maxsize} || ($normalyzed_info{$stmt}{tempfiles}{maxsize} < $_normalyzed_info{$stmt}{tempfiles}{maxsize})) {
                                $normalyzed_info{$stmt}{tempfiles}{maxsize} = $_normalyzed_info{$stmt}{tempfiles}{maxsize};
                        }
                }
@@ -12981,7 +12981,7 @@ sub parse_query
        my $fmt = shift;
 
        my $is_log_level = 0;
-       
+
        my $t_pid = $prefix_vars{'t_pid'};
 
        my $date_part = "$prefix_vars{'t_year'}$prefix_vars{'t_month'}$prefix_vars{'t_day'}";
@@ -13324,7 +13324,7 @@ sub parse_query
                                if ($1 > $autovacuum_info{peak}{system_usage}{elapsed}) {
                                        $autovacuum_info{peak}{system_usage}{elapsed} = $1;
                                        $autovacuum_info{peak}{system_usage}{table} = $cur_info{$t_pid}{vacuum};
-                                       $autovacuum_info{peak}{system_usage}{date} = 
+                                       $autovacuum_info{peak}{system_usage}{date} =
                                                "$prefix_vars{'t_year'}-$prefix_vars{'t_month'}-$prefix_vars{'t_day'} " .
                                                "$prefix_vars{'t_hour'}:$prefix_vars{'t_min'}:$prefix_vars{'t_sec'}";
                                }
@@ -14013,14 +14013,14 @@ sub store_queries
                if ($sample > 0) {
                        my $cur_last_log_timestamp = "$cur_info{$t_pid}{year}-$cur_info{$t_pid}{month}-$cur_info{$t_pid}{day} " .
                                                        "$cur_info{$t_pid}{hour}:$cur_info{$t_pid}{min}:$cur_info{$t_pid}{sec}";
-                       &set_top_error_sample(  $normalized_error, 
-                                                                       $cur_last_log_timestamp, 
-                                                                       $cur_info{$t_pid}{query}, 
+                       &set_top_error_sample(  $normalized_error,
+                                                                       $cur_last_log_timestamp,
+                                                                       $cur_info{$t_pid}{query},
                                                                        $cur_info{$t_pid}{detail},
-                                                                       $cur_info{$t_pid}{context}, 
-                                                                       $cur_info{$t_pid}{statement}, 
-                                                                       $cur_info{$t_pid}{hint}, 
-                                                                       $cur_info{$t_pid}{dbname}, 
+                                                                       $cur_info{$t_pid}{context},
+                                                                       $cur_info{$t_pid}{statement},
+                                                                       $cur_info{$t_pid}{hint},
+                                                                       $cur_info{$t_pid}{dbname},
                                                                        $cur_info{$t_pid}{dbuser},
                                                                        $cur_info{$t_pid}{dbappname},
                                                                        $cur_info{$t_pid}{dbclient},
@@ -14616,7 +14616,7 @@ sub search_log_format
 
        return ($fmt, $ident_name);
 }
-       
+
 sub progress_bar
 {
        my ($got, $total, $width, $char, $queries, $errors) = @_;
@@ -15187,7 +15187,7 @@ sub split_logfile
                        $chunks[0] = $saved_pos;
                }
        }
-       # With small files splitting is inefficient 
+       # With small files splitting is inefficient
        if ($totalsize <= 16777216) {
                return ($chunks[0], $totalsize);
        }
@@ -15236,7 +15236,7 @@ sub get_week_number
        } else {
                $weekNumber = POSIX::strftime("%W", 1, 1, 1, $day, $month - 1, $year - 1900);
        }
-       
+
 
        return sprintf("%02d", $weekNumber+1);
 }
@@ -15313,7 +15313,7 @@ sub get_wdays_per_month
 sub IsLeapYear
 {
        return ((($_[0] & 3) == 0) && (($_[0] % 100 != 0) || ($_[0] % 400 == 0)));
-} 
+}
 
 ####
 # Display calendar
@@ -15365,7 +15365,7 @@ sub get_calendar
                        $str .= "<tr>$week" . join('', @currow) . "</tr>\n";
                        @currow = ('','','','','','','');
                }
-       } 
+       }
        if ( ($wd != 6) || ($currow[0] ne '') ) {
                $week = sprintf("%02d", $wn);
                if (-e "$outdir/$year/week-$week/index.html") {
@@ -15758,7 +15758,7 @@ sub query {
                 while ($tmp_str =~ s/\s+AS\s+([^\s]+)\s+//is) {
                     my $code_sep = quotemeta($1);
                    foreach my $k (@{ $self->{ 'keywords' } }) {
-                           last if ($code_sep =~ s/\b$k$//i); 
+                           last if ($code_sep =~ s/\b$k$//i);
                    }
                     if ($tmp_str =~ /\s+$code_sep[\s;]+/) {
                         while ( $temp_content[$j] =~ s/($code_sep.*$code_sep)/CODEPART${i}CODEPART/s) {
@@ -16149,7 +16149,7 @@ sub beautify {
         elsif ($token =~ /^(RETURN|RETURNS)$/i) {
             $self->{ '_is_in_index' } = 0;
         }
-    
+
         ####
         # Mark statements that use string_agg() or group_concat() function
         # as statement that can have an ORDER BY clause inside the call to
@@ -16329,7 +16329,7 @@ sub beautify {
             $self->{ '_is_in_type' }-- if ($self->{ '_is_in_type' });
             $self->_new_line if ($self->{ '_current_sql_stmt' } ne 'INSERT'
                            and !$self->{ '_is_in_function' }
-                           and (defined $self->_next_token 
+                           and (defined $self->_next_token
                                    and $self->_next_token =~ /^(SELECT|WITH)$/i)
                            and $last ne ')'
            );
@@ -16714,7 +16714,7 @@ sub beautify {
            {
                 $self->_new_line;
                 $self->_over if (!$self->{ '_is_in_join' });
-            } 
+            }
             $self->_add_token( $token );
         }
 
@@ -16798,7 +16798,7 @@ sub beautify {
         }
         elsif ($token =~ /^\\\S/)
        {
-           # treat everything starting with a \ and at least one character as psql meta command. 
+           # treat everything starting with a \ and at least one character as psql meta command.
             $self->_add_token( $token );
             $self->_new_line;
         }
@@ -16902,7 +16902,7 @@ sub _add_token {
         if ( (!defined($last_token) || $last_token ne '(') && $token ne ')' && ($token !~ /^::/) ) {
             $self->{ 'content' } .= $sp if ($token ne ')'
                                             && defined($last_token)
-                                            && $last_token ne '::' 
+                                            && $last_token ne '::'
                                             && ($token ne '(' || !$self->_is_function( $last_token ) || $self->{ '_is_in_type' })
                 );
             $self->{ 'content' } .= $sp if (!defined($last_token) && $token);
@@ -17410,7 +17410,7 @@ sub set_dicts {
     # First load it all as "my" variables, to make it simpler to modify/map/grep/add
     # Afterwards, when everything is ready, put it in $self->{'dict'}->{...}
 
-    my @pg_keywords = map { uc } qw( 
+    my @pg_keywords = map { uc } qw(
         ADD AFTER ALL ALTER ANALYSE ANALYZE AND ANY ARRAY AS ASC ASYMMETRIC AUTHORIZATION AUTO_INCREMENT
         BACKWARD BEFORE BEGIN BERNOULLI BETWEEN BINARY BOTH BY BY CACHE CASCADE CASE CAST CHECK CHECKPOINT
         CLOSE CLUSTER COLLATE COLLATION COLUMN COMMENT COMMIT COMMITTED CONCURRENTLY CONFLICT CONSTRAINT
@@ -17823,7 +17823,7 @@ sub _remove_dynamic_code
         }
     }
 
-    # Replace any COMMENT constant between single quote 
+    # Replace any COMMENT constant between single quote
     while ($$str =~ s/IS\s+('[^;]+);/IS TEXTVALUE$idx;/s) {
         $self->{dynamic_code}{$idx} = $1;
         $idx++;