Commit ae204cdb authored by Alper Akgun's avatar Alper Akgun

Disable batch counting for "pipelines that have security jobs" metrics

parent 682ec79a
...@@ -338,7 +338,6 @@ module EE ...@@ -338,7 +338,6 @@ module EE
# rubocop:disable CodeReuse/ActiveRecord # rubocop:disable CodeReuse/ActiveRecord
# rubocop: disable UsageData/LargeTable # rubocop: disable UsageData/LargeTable
# rubocop: disable UsageData/DistinctCountByLargeForeignKey
def count_secure_jobs(time_period) def count_secure_jobs(time_period)
start = ::Security::Scan.minimum(:build_id) start = ::Security::Scan.minimum(:build_id)
finish = ::Security::Scan.maximum(:build_id) finish = ::Security::Scan.maximum(:build_id)
...@@ -365,13 +364,12 @@ module EE ...@@ -365,13 +364,12 @@ module EE
.where(status: 'success', retried: [nil, false]) .where(status: 'success', retried: [nil, false])
.where('security_scans.scan_type = ?', scan_type) .where('security_scans.scan_type = ?', scan_type)
.where(time_period) .where(time_period)
pipelines_with_secure_jobs["#{name}_pipeline".to_sym] = distinct_count(relation, :commit_id, start: start, finish: finish) pipelines_with_secure_jobs["#{name}_pipeline".to_sym] = distinct_count(relation, :commit_id, start: start, finish: finish, batch: false)
end end
pipelines_with_secure_jobs pipelines_with_secure_jobs
end end
# rubocop: enable UsageData/LargeTable # rubocop: enable UsageData/LargeTable
# rubocop: enable UsageData/DistinctCountByLargeForeignKey
def approval_merge_request_rule_minimum_id def approval_merge_request_rule_minimum_id
strong_memoize(:approval_merge_request_rule_minimum_id) do strong_memoize(:approval_merge_request_rule_minimum_id) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment