1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-03-05 15:05:48 +02:00

Better thread logging.

This commit is contained in:
David Steele 2014-02-13 18:07:58 -05:00
parent 2bafa5cf26
commit 1bec36b65b

View File

@ -659,8 +659,10 @@ sub backup_file
my $iThreadFileLargeTotal = 0; my $iThreadFileLargeTotal = 0;
&log(INFO, "file total ${lFileTotal}"); &log(INFO, "file total ${lFileTotal}");
&log(INFO, "file small total ${lFileSmallTotal}, small size: " . file_size_format($lFileSmallSize) . ", small thread avg total ${iThreadFileSmallTotalMax}"); &log(INFO, "file small total ${lFileSmallTotal}, small size: " . file_size_format($lFileSmallSize) .
&log(INFO, "file large total ${lFileLargeTotal}, large size: " . file_size_format($lFileLargeSize) . ", large thread avg size " . file_size_format(int($fThreadFileLargeSizeMax))); ", small thread avg total ${iThreadFileSmallTotalMax} (");
&log(INFO, "file large total ${lFileLargeTotal}, large size: " . file_size_format($lFileLargeSize) .
", large thread avg size " . file_size_format(int($fThreadFileLargeSizeMax)));
foreach my $strFile (sort {$b cmp $a} (keys %oFileCopyMap)) foreach my $strFile (sort {$b cmp $a} (keys %oFileCopyMap))
{ {
@ -675,7 +677,8 @@ sub backup_file
if ($fThreadFileLargeSize >= $fThreadFileLargeSizeMax && $iThreadFileLargeIdx < $iThreadMax - 1) if ($fThreadFileLargeSize >= $fThreadFileLargeSizeMax && $iThreadFileLargeIdx < $iThreadMax - 1)
{ {
&log(INFO, "thread ${iThreadFileLargeIdx} large total ${iThreadFileLargeTotal}, size ${fThreadFileLargeSize}"); &log(INFO, "thread ${iThreadFileLargeIdx} large total ${iThreadFileLargeTotal}, size ${fThreadFileLargeSize}" .
" (" . file_size_format(int(${fThreadFileLargeSize})) . ")");
$iThreadFileLargeIdx++; $iThreadFileLargeIdx++;
$fThreadFileLargeSize = 0; $fThreadFileLargeSize = 0;
@ -691,7 +694,8 @@ sub backup_file
if ($iThreadFileSmallTotal >= $iThreadFileSmallTotalMax && $iThreadFileSmallIdx < $iThreadMax - 1) if ($iThreadFileSmallTotal >= $iThreadFileSmallTotalMax && $iThreadFileSmallIdx < $iThreadMax - 1)
{ {
&log(INFO, "thread ${iThreadFileSmallIdx} small total ${iThreadFileSmallTotal}, size ${fThreadFileSmallSize}"); &log(INFO, "thread ${iThreadFileSmallIdx} small total ${iThreadFileSmallTotal}, size ${fThreadFileSmallSize}" .
" (" . file_size_format(int(${fThreadFileSmallSize})) . ")");
$iThreadFileSmallIdx++; $iThreadFileSmallIdx++;
$fThreadFileSmallSize = 0; $fThreadFileSmallSize = 0;
@ -700,8 +704,10 @@ sub backup_file
} }
} }
&log(INFO, "thread ${iThreadFileLargeIdx} large total ${iThreadFileLargeTotal}, size ${fThreadFileLargeSize}"); &log(INFO, "thread ${iThreadFileLargeIdx} large total ${iThreadFileLargeTotal}, size ${fThreadFileLargeSize}" .
&log(INFO, "thread ${iThreadFileSmallIdx} small total ${iThreadFileSmallTotal}, size ${fThreadFileSmallSize}"); " (" . file_size_format(int(${fThreadFileLargeSize})) . ")");
&log(INFO, "thread ${iThreadFileSmallIdx} small total ${iThreadFileSmallTotal}, size ${fThreadFileSmallSize}" .
" (" . file_size_format(int(${fThreadFileLargeSize})) . ")");
# End each thread queue and start the thread # End each thread queue and start the thread
for (my $iThreadIdx = 0; $iThreadIdx < $iThreadMax; $iThreadIdx++) for (my $iThreadIdx = 0; $iThreadIdx < $iThreadMax; $iThreadIdx++)