debian-mirror-gitlab/lib/gitlab/cycle_analytics/summary/deploy.rb

29 lines
686 B
Ruby
Raw Normal View History

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-09-04 01:27:46 +05:30
.new(project: @project, finished_after: @options[:from], finished_before: @options[: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
2021-11-11 11:23:49 +05:30
Gitlab::CycleAnalytics::Summary::Deploy.prepend_mod_with('Gitlab::CycleAnalytics::Summary::Deploy')