Skip to content

Commit

Permalink
Do not collect C&U for things that do not support it
Browse files Browse the repository at this point in the history
  • Loading branch information
isimluk committed Jun 9, 2017
1 parent be8613f commit 97c63bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/metric/targets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def self.capture_infra_targets(zone, options)
# this logic into capture_host_targets
def self.only_enabled(hosts)
hosts.select do |host|
host.ems_cluster ? host.ems_cluster.perf_capture_enabled? : host.perf_capture_enabled?
host.supports_capture? && (host.ems_cluster ? host.ems_cluster.perf_capture_enabled? : host.perf_capture_enabled?)
end
end

Expand Down Expand Up @@ -123,7 +123,7 @@ def self.capture_storage_targets(hosts)
# @param [Host] hosts that are enabled or cluster enabled
def self.capture_vm_targets(hosts)
hosts.select(&:perf_capture_enabled?)
.flat_map { |t| t.vms.select { |v| v.ext_management_system && v.state == 'on' } }
.flat_map { |t| t.vms.select { |v| v.ext_management_system && v.state == 'on' && v.supports_capture? } }
end

# If a Cluster, standalone Host, or Storage is not enabled, skip it.
Expand Down

0 comments on commit 97c63bb

Please sign in to comment.