This commit is contained in:
garnier-quentin 2020-07-31 15:11:57 +02:00
parent 948c3814be
commit d6687ae2bf
3 changed files with 16 additions and 16 deletions

View File

@ -105,8 +105,8 @@ sub run {
push @$query_perfs, { push @$query_perfs, {
entity => $entity_view, entity => $entity_view,
metrics => [ metrics => [
{label => 'datastore.totalReadLatency.average', instances => $instances}, { label => 'datastore.totalReadLatency.average', instances => $instances },
{label => 'datastore.totalWriteLatency.average', instances => $instances} { label => 'datastore.totalWriteLatency.average', instances => $instances }
] ]
}; };
} }

View File

@ -499,14 +499,14 @@ sub search_entities {
my $begin_views = []; my $begin_views = [];
foreach my $scope (['scope_datacenter', 'Datacenter'], ['scope_cluster', 'ClusterComputeResource'], ['scope_host', 'HostSystem']) { foreach my $scope (['scope_datacenter', 'Datacenter'], ['scope_cluster', 'ClusterComputeResource'], ['scope_host', 'HostSystem']) {
if (defined($options{command}->{$$scope[0]}) && $options{command}->{$$scope[0]} ne '') { if (defined($options{command}->{$scope->[0]}) && $options{command}->{$scope->[0]} ne '') {
my $filters = { name => qr/$options{command}->{$$scope[0]}/ }; my $filters = { name => qr/$options{command}->{$scope->[0]}/ };
if (scalar(@$begin_views) > 0) { if (scalar(@$begin_views) > 0) {
my $temp_views = []; my $temp_views = [];
while ((my $view = shift @$begin_views)) { while ((my $view = shift @$begin_views)) {
my ($status, $views) = find_entity_views( my ($status, $views) = find_entity_views(
connector => $options{command}->{connector}, connector => $options{command}->{connector},
view_type => $$scope[1], view_type => $scope->[1],
properties => $properties, properties => $properties,
filter => $filters, filter => $filters,
begin_entity => $view, begin_entity => $view,
@ -518,12 +518,12 @@ sub search_entities {
} }
if (scalar(@$temp_views) == 0) { if (scalar(@$temp_views) == 0) {
set_response(code => 1, short_message => "Cannot find '$$scope[1]' object"); set_response(code => 1, short_message => "Cannot find '$scope->[1]' object");
return undef; return undef;
} }
push @$begin_views, @$temp_views; push @$begin_views, @$temp_views;
} else { } else {
my ($status, $views) = find_entity_views(connector => $options{command}->{connector}, view_type => $$scope[1], properties => $properties, filter => $filters); my ($status, $views) = find_entity_views(connector => $options{command}->{connector}, view_type => $scope->[1], properties => $properties, filter => $filters);
# We quit. No scope find # We quit. No scope find
return undef if ($status <= 0); return undef if ($status <= 0);
push @$begin_views, @$views; push @$begin_views, @$views;