From 7bd3090330bf4ee8076737492fbf0dec1001da9c Mon Sep 17 00:00:00 2001 From: Greg Blomquist Date: Mon, 20 Mar 2017 14:29:33 -0400 Subject: [PATCH] Fixes for rubocops in metric capture --- app/models/metric/ci_mixin/capture.rb | 2 +- spec/models/metric/ci_mixin/capture_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/metric/ci_mixin/capture.rb b/app/models/metric/ci_mixin/capture.rb index d955dd8cc6b..d4c8a4ab1b2 100644 --- a/app/models/metric/ci_mixin/capture.rb +++ b/app/models/metric/ci_mixin/capture.rb @@ -17,7 +17,7 @@ def queue_name_for_metrics_collection ems.metrics_collector_queue_name end - def split_capture_intervals(interval_name, start_time, end_time, threshold=1.day) + def split_capture_intervals(interval_name, start_time, end_time, threshold = 1.day) raise _("Start time must be earlier than End time") if start_time > end_time # Create an array of ordered pairs from start_time and end_time so that each ordered pair is contained # within the threshold. Then, reverse it so the newest ordered pair is first: diff --git a/spec/models/metric/ci_mixin/capture_spec.rb b/spec/models/metric/ci_mixin/capture_spec.rb index 244e2dbecc9..3538da9d97d 100644 --- a/spec/models/metric/ci_mixin/capture_spec.rb +++ b/spec/models/metric/ci_mixin/capture_spec.rb @@ -58,7 +58,7 @@ def test_perf_capture_queue(time_since_last_perf_capture, total_queue_items, ver expect(q_end_time).to be_same_time_as interval_end_time interval_end_time = interval_start_time # if the collection threshold is ever parameterized, then this 1.day will have to change - interval_start_time = interval_start_time - 1.day + interval_start_time -= 1.day end end end