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

30 lines
577 B
Ruby
Raw Normal View History

2020-04-22 19:07:51 +05:30
# frozen_string_literal: true
module Gitlab
module CycleAnalytics
module Summary
class DeploymentFrequency < Base
include SummaryHelper
def initialize(deployments:, from:, to: nil, project: nil)
@deployments = deployments
super(project: project, from: from, to: to)
end
def title
_('Deployment Frequency')
end
def value
2020-05-24 23:13:21 +05:30
@value ||= frequency(@deployments, @from, @to || Time.now)
2020-04-22 19:07:51 +05:30
end
def unit
_('per day')
end
end
end
end
end