Skip to content

Commit

Permalink
remove unneeded interval check
Browse files Browse the repository at this point in the history
perf_capture_queue is an internal method now.
So there parameters do not need to be checked.

The interval is determined from perf_target_to_interval_name, which
is 100% under our control, and the options hash, which is from
perf_capture_gap or perf_capture_realtime_now. (and the last one
is slated to go away soon)

Checking on every insert seemed like waste
  • Loading branch information
kbrock committed Nov 20, 2019
1 parent 7742cc7 commit a7404eb
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions app/models/manageiq/providers/base_manager/metrics_capture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ def perf_capture_queue(target, interval_name, options = {})
priority = options[:priority] || Metric::Capture.interval_priority(interval_name)
task_id = options[:task_id]

raise ArgumentError, "invalid interval_name '#{interval_name}'" unless Metric::Capture::VALID_CAPTURE_INTERVALS.include?(interval_name)
raise ArgumentError, "target does not have an ExtManagementSystem" if ems.nil?

# cb is the task used to group cluster realtime metrics
cb = {:class_name => target.class.name, :instance_id => target.id, :method_name => :perf_capture_callback, :args => [[task_id]]} if task_id && interval_name == 'realtime'
items = queue_items_for_interval(target, interval_name, start_time, end_time)
Expand Down

0 comments on commit a7404eb

Please sign in to comment.