fix aws apigateway and kinesis

This commit is contained in:
Colin Gagnaire 2019-09-12 14:50:20 +02:00
parent a0996663ff
commit 318df142f2
4 changed files with 27 additions and 14 deletions

View File

@ -150,11 +150,14 @@ sub manage_selection {
);
foreach my $metric (@{$self->{aws_metrics}}) {
foreach my $statistic (@{$self->{aws_statistics}}) {
next if (!defined($metric_results{$instance}->{$metric}->{lc($statistic)}) && !defined($self->{option_results}->{zeroed}));
next if (!defined($metric_results{$instance}->{$metric}->{lc($statistic)})
&& !defined($self->{option_results}->{zeroed}));
$self->{metrics}->{$instance}->{display} = $instance;
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{display} = $statistic;
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{$metric} = defined($metric_results{$instance}->{$metric}->{lc($statistic)}) ?
$metric_results{$instance}->{$metric}->{lc($statistic)} : 0;
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{$metric} =
defined($metric_results{$instance}->{$metric}->{lc($statistic)}) ?
$metric_results{$instance}->{$metric}->{lc($statistic)} : 0;
}
}
}

View File

@ -152,12 +152,14 @@ sub manage_selection {
foreach my $metric (@{$self->{aws_metrics}}) {
foreach my $statistic (@{$self->{aws_statistics}}) {
next if (!defined($metric_results{$instance}->{$metric}->{lc($statistic)}) && !defined($self->{option_results}->{zeroed}));
next if (!defined($metric_results{$instance}->{$metric}->{lc($statistic)})
&& !defined($self->{option_results}->{zeroed}));
$self->{metrics}->{$instance}->{display} = $instance;
$self->{metrics}->{$instance}->{availability_zone} = $self->{option_results}->{availability_zone};
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{display} = $statistic;
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{$metric} = defined($metric_results{$instance}->{$metric}->{lc($statistic)}) ? $metric_results{$instance}->{$metric}->{lc($statistic)} : 0;
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{$metric} =
defined($metric_results{$instance}->{$metric}->{lc($statistic)}) ?
$metric_results{$instance}->{$metric}->{lc($statistic)} : 0;
}
}
}

View File

@ -190,12 +190,16 @@ sub manage_selection {
);
foreach my $metric (@{$self->{aws_metrics}}) {
foreach my $statistic (@{$self->{aws_statistics}}) {
next if (!defined($metric_results{$instance}->{$metric}->{lc($statistic)}) && !defined($self->{option_results}->{zeroed})
|| defined($metrics_mapping{$metric}->{stats}->{lc($statistic)}) && $metrics_mapping{$metric}->{stats}->{lc($statistic)} eq "false");
next if (!defined($metric_results{$instance}->{$metric}->{lc($statistic)})
&& !defined($self->{option_results}->{zeroed})
|| defined($metrics_mapping{$metric}->{stats}->{lc($statistic)})
&& $metrics_mapping{$metric}->{stats}->{lc($statistic)} eq "false");
$self->{metrics}->{$instance}->{display} = $instance;
$self->{metrics}->{$instance}->{availability_zone} = $self->{option_results}->{availability_zone};
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{display} = $statistic;
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{$metric} = defined($metric_results{$instance}->{$metric}->{lc($statistic)}) ? $metric_results{$instance}->{$metric}->{lc($statistic)} : 0;
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{$metric} =
defined($metric_results{$instance}->{$metric}->{lc($statistic)}) ?
$metric_results{$instance}->{$metric}->{lc($statistic)} : 0;
}
}
}

View File

@ -166,12 +166,16 @@ sub manage_selection {
);
foreach my $metric (@{$self->{aws_metrics}}) {
foreach my $statistic (@{$self->{aws_statistics}}) {
next if (!defined($metric_results{$instance}->{$metric}->{lc($statistic)}) && !defined($self->{option_results}->{zeroed})
|| defined($metrics_mapping{$metric}->{stats}->{lc($statistic)}) && $metrics_mapping{$metric}->{stats}->{lc($statistic)} eq "false");
next if (!defined($metric_results{$instance}->{$metric}->{lc($statistic)})
&& !defined($self->{option_results}->{zeroed})
|| defined($metrics_mapping{$metric}->{stats}->{lc($statistic)})
&& $metrics_mapping{$metric}->{stats}->{lc($statistic)} eq "false");
$self->{metrics}->{$instance}->{display} = $instance;
$self->{metrics}->{$instance}->{availability_zone} = $self->{option_results}->{availability_zone};
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{display} = $statistic;
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{$metric} = defined($metric_results{$instance}->{$metric}->{lc($statistic)}) ? $metric_results{$instance}->{$metric}->{lc($statistic)} : 0;
$self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{$metric} =
defined($metric_results{$instance}->{$metric}->{lc($statistic)}) ?
$metric_results{$instance}->{$metric}->{lc($statistic)} : 0;
}
}
}