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

Methods included from Defaults

#identifier

Constructor Details

#initialize(deployments:, options:, project:) ⇒ 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:, options:, project:)
  @deployments = deployments

  super(project: project, options: options)
end

Instance Method Details


27
28
29
30
31
32
# File 'lib/gitlab/cycle_analytics/summary/deployment_frequency.rb', line 27

def links
  [
    { "name" => _('Deployment frequency'), "url" => Gitlab::Routing.url_helpers.charts_project_pipelines_path(project, chart: 'deployment-frequency'), "label" => s_('ValueStreamAnalytics|Dashboard') },
    { "name" => _('Deployment frequency'), "url" => Gitlab::Routing.url_helpers.help_page_path('user/analytics/index', anchor: 'definitions'), "docs_link" => true, "label" => s_('ValueStreamAnalytics|Go to docs') }
  ]
end

#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
  _('/day')
end

#valueObject


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

def value
  @value ||= frequency(@deployments, @options[:from], @options[:to] || Time.current)
end