2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-09-13 17:45:13 +05:30
|
|
|
module Ci
|
2020-01-01 13:55:28 +05:30
|
|
|
class ProcessPipelineService
|
2016-09-13 17:45:13 +05:30
|
|
|
attr_reader :pipeline
|
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
def initialize(pipeline)
|
2016-09-13 17:45:13 +05:30
|
|
|
@pipeline = pipeline
|
2020-01-01 13:55:28 +05:30
|
|
|
end
|
2016-09-13 17:45:13 +05:30
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
def execute
|
2020-07-28 23:09:34 +05:30
|
|
|
increment_processing_counter
|
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
Ci::PipelineProcessing::AtomicProcessingService
|
|
|
|
.new(pipeline)
|
|
|
|
.execute
|
2019-10-12 21:52:04 +05:30
|
|
|
end
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
def metrics
|
2021-04-29 21:17:54 +05:30
|
|
|
@metrics ||= ::Gitlab::Ci::Pipeline::Metrics
|
2020-07-28 23:09:34 +05:30
|
|
|
end
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
private
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
def increment_processing_counter
|
|
|
|
metrics.pipeline_processing_events_counter.increment
|
|
|
|
end
|
2016-09-13 17:45:13 +05:30
|
|
|
end
|
|
|
|
end
|