From 1bec36b65b9ed5f2ca31879dc03877708ce048df Mon Sep 17 00:00:00 2001 From: David Steele Date: Thu, 13 Feb 2014 18:07:58 -0500 Subject: [PATCH] Better thread logging. --- pg_backrest_backup.pm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pg_backrest_backup.pm b/pg_backrest_backup.pm index 7fd0f8efd..afd4e05f4 100644 --- a/pg_backrest_backup.pm +++ b/pg_backrest_backup.pm @@ -659,8 +659,10 @@ sub backup_file my $iThreadFileLargeTotal = 0; &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 large total ${lFileLargeTotal}, large size: " . file_size_format($lFileLargeSize) . ", large thread avg size " . file_size_format(int($fThreadFileLargeSizeMax))); + &log(INFO, "file small total ${lFileSmallTotal}, small size: " . file_size_format($lFileSmallSize) . + ", 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)) { @@ -675,7 +677,8 @@ sub backup_file 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++; $fThreadFileLargeSize = 0; @@ -691,8 +694,9 @@ sub backup_file 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++; $fThreadFileSmallSize = 0; $iThreadFileSmallTotal = 0; @@ -700,8 +704,10 @@ sub backup_file } } - &log(INFO, "thread ${iThreadFileLargeIdx} large total ${iThreadFileLargeTotal}, size ${fThreadFileLargeSize}"); - &log(INFO, "thread ${iThreadFileSmallIdx} small total ${iThreadFileSmallTotal}, size ${fThreadFileSmallSize}"); + &log(INFO, "thread ${iThreadFileLargeIdx} large total ${iThreadFileLargeTotal}, size ${fThreadFileLargeSize}" . + " (" . 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 for (my $iThreadIdx = 0; $iThreadIdx < $iThreadMax; $iThreadIdx++)