Edit size consistency

master
Heuzef 5 years ago
parent 33f48b770a
commit 82913124cb
  1. 37
      Check.pm

@ -96,26 +96,33 @@ sub action
} }
# Using a mathematical formula to calculate the consistency of the average size, for new files, on all backups # Using a mathematical formula to calculate the consistency of the average size, for new files, on all backups
# TOO BIG ? If the size is 6 times higher than usual :
my $toobig = 0; my $toobig = 0;
if ( $new_size > ($new_size_q3 + $new_size_q3 - $new_size_q1) * 1.5 or $new_size > $new_size_avg * 6 ) {
$toobig = 1;
}
# TOO SMALL ? If the size is 3 times lower than usual :
my $toosmall = 0; my $toosmall = 0;
if ( $new_size < ($new_size_q1 - $new_size_q3 - $new_size_q1) * 1.5 or $new_size < $new_size_avg / 3 ) {
$toosmall = 1;
}
# Get result if ( $Backups[-4] ) {
my $sizeConsistency = "<strong>ANOMALOUS</strong>"; # TOO BIG ? If the size is 6 times higher than usual :
my $sizeConsistencyColor = "Tomato"; if ( $new_size > ($new_size_q3 + $new_size_q3 - $new_size_q1) * 1.5 or $new_size > $new_size_avg * 6 ) {
if ( not $toobig and not $toosmall ) { $toobig = 1;
$sizeConsistency = "Normal"; }
$sizeConsistencyColor = "MediumSeaGreen";
# TOO SMALL ? If the size is 3 times lower than usual :
if ( $new_size < ($new_size_q1 - $new_size_q3 - $new_size_q1) * 1.5 or $new_size < $new_size_avg / 3 ) {
$toosmall = 1;
}
# Get result
my $sizeConsistencyColor = "Tomato";
my $sizeConsistency = "<strong>ANOMALOUS</strong>";
if ( not $toobig and not $toosmall ) {
$sizeConsistencyColor = "MediumSeaGreen";
$sizeConsistency = "Normal";
}
} else {
my $sizeConsistencyColor = "MediumSeaGreen";
my $sizeConsistency = "<em>Not enough backups</em>";
} }
# Get URL for explore file # Get URL for explore file
my $browseFile = "?action=browse&host=$host"; my $browseFile = "?action=browse&host=$host";

Loading…
Cancel
Save