Try to remove loop for age

master
Heuzef 5 years ago
parent 8bb85a1191
commit ed9356673d
  1. 8
      Check.pm

@ -51,13 +51,10 @@ sub action
}
# Age
for ( my $i = 0 ; $i < @Backups ; $i++ ) {
if ( $Backups[$i]{type} eq "full" or "incr" ) {
$lastAge = sprintf("%.1f", (time - $Backups[-1]{startTime}) / (24 * 3600));
}
if ( $Backups{type} eq "full" or "incr" ) {
$lastAge = sprintf("%.1f", (time - $Backups[-1]{startTime}) / (24 * 3600));
}
# Color for age
if ( $lastAge < $frequency ) {
$lastAgeColor = "MediumSeaGreen";
@ -100,7 +97,6 @@ sub action
# Ignore the last backup if it's not full or incr (which means it's either partial or active)
my $i = ( $Backups[-1]->{type} =~ m/^full|incr$/ ) ? -1 : -2;
$new_size = $Backups[$i]->{sizeNew};
$new_size_avg = int $sizes->mean;
$new_size_q1 = eval { int $sizes->quantile(1) } || 0;

Loading…
Cancel
Save