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
|
|
|
|
.new(project: @project, finished_after: @from, finished_before: @to, status: :success)
|
|
|
|
.execute
|
|
|
|
.count
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|