mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-23 21:55:16 +02:00
some typo
This commit is contained in:
parent
8e02f9d4ae
commit
27da1f7647
@ -191,27 +191,26 @@ sub compute {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
my $result;
|
||||
|
||||
if ($options{aggregation} eq 'average') {
|
||||
my $points = 0;
|
||||
foreach my $value (@{$options{values}}) {
|
||||
$result = 0 if (!defined($result));
|
||||
$result += $$value[$options{column}];
|
||||
$result += $value->[$options{column}];
|
||||
$points++;
|
||||
}
|
||||
$result /= $points;
|
||||
} elsif ($options{aggregation} eq 'minimum') {
|
||||
foreach my $value (@{$options{values}}) {
|
||||
$result = $$value[$options{column}] if (!defined($result) || $$value[$options{column}] < $result);
|
||||
$result = $value->[$options{column}] if (!defined($result) || $value->[$options{column}] < $result);
|
||||
}
|
||||
} elsif ($options{aggregation} eq 'maximum') {
|
||||
foreach my $value (@{$options{values}}) {
|
||||
$result = $$value[$options{column}] if (!defined($result) || $$value[$options{column}] > $result);
|
||||
$result = $value->[$options{column}] if (!defined($result) || $value->[$options{column}] > $result);
|
||||
}
|
||||
} elsif ($options{aggregation} eq 'sum') {
|
||||
foreach my $value (@{$options{values}}) {
|
||||
$result = 0 if (!defined($result));
|
||||
$result += $$value[$options{column}];
|
||||
$result += $value->[$options{column}];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user