2018-07-16 12:31:01 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-11 09:22:35 -04:00
|
|
|
module Ci
|
2019-11-19 07:06:00 -05:00
|
|
|
class ProcessPipelineService
|
2016-08-11 09:22:35 -04:00
|
|
|
attr_reader :pipeline
|
|
|
|
|
2019-11-19 07:06:00 -05:00
|
|
|
def initialize(pipeline)
|
2016-08-11 09:22:35 -04:00
|
|
|
@pipeline = pipeline
|
2019-11-19 07:06:00 -05:00
|
|
|
end
|
2016-08-11 09:22:35 -04:00
|
|
|
|
2020-08-13 11:10:03 -04:00
|
|
|
def execute
|
2020-07-15 08:09:26 -04:00
|
|
|
increment_processing_counter
|
|
|
|
|
2020-08-13 11:10:03 -04:00
|
|
|
Ci::PipelineProcessing::AtomicProcessingService
|
|
|
|
.new(pipeline)
|
|
|
|
.execute
|
2016-08-11 09:22:35 -04:00
|
|
|
end
|
|
|
|
|
2020-07-15 08:09:26 -04:00
|
|
|
def metrics
|
2021-04-15 11:09:11 -04:00
|
|
|
@metrics ||= ::Gitlab::Ci::Pipeline::Metrics
|
2020-07-15 08:09:26 -04:00
|
|
|
end
|
|
|
|
|
2016-08-11 09:22:35 -04:00
|
|
|
private
|
|
|
|
|
2020-07-15 08:09:26 -04:00
|
|
|
def increment_processing_counter
|
|
|
|
metrics.pipeline_processing_events_counter.increment
|
|
|
|
end
|
2016-08-11 09:22:35 -04:00
|
|
|
end
|
|
|
|
end
|