2019-02-15 15:39:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
module Gitlab
|
|
|
|
module CycleAnalytics
|
|
|
|
module Summary
|
|
|
|
class Deploy < Base
|
|
|
|
def title
|
2020-06-23 00:09:42 +05:30
|
|
|
n_('Deploy', 'Deploys', value.to_i)
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def value
|
2020-05-24 23:13:21 +05:30
|
|
|
@value ||= Value::PrettyNumeric.new(deployments_count)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def deployments_count
|
2021-04-17 20:07:23 +05:30
|
|
|
DeploymentsFinder
|
2021-06-08 01:23:25 +05:30
|
|
|
.new(project: @project, finished_after: @from, finished_before: @to, status: :success, order_by: :finished_at)
|
2021-04-17 20:07:23 +05:30
|
|
|
.execute
|
|
|
|
.count
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|