Class: Gitlab::CycleAnalytics::Summary::DeploymentFrequency

Inherits:
Base
  • Object
show all
Includes:
Gitlab::CycleAnalytics::SummaryHelper
Defined in:
lib/gitlab/cycle_analytics/summary/deployment_frequency.rb

Instance Method Summary collapse

Methods included from Gitlab::CycleAnalytics::SummaryHelper

#days, #frequency

Constructor Details

#initialize(deployments:, from:, to: nil, project: nil) ⇒ DeploymentFrequency

Returns a new instance of DeploymentFrequency.


9
10
11
12
13
# File 'lib/gitlab/cycle_analytics/summary/deployment_frequency.rb', line 9

def initialize(deployments:, from:, to: nil, project: nil)
  @deployments = deployments

  super(project: project, from: from, to: to)
end

Instance Method Details

#titleObject


15
16
17
# File 'lib/gitlab/cycle_analytics/summary/deployment_frequency.rb', line 15

def title
  _('Deployment Frequency')
end

#unitObject


23
24
25
# File 'lib/gitlab/cycle_analytics/summary/deployment_frequency.rb', line 23

def unit
  _('per day')
end

#valueObject


19
20
21
# File 'lib/gitlab/cycle_analytics/summary/deployment_frequency.rb', line 19

def value
  @value ||= frequency(@deployments, @from, @to || Time.now)
end