Class: Gitlab::CycleAnalytics::Summary::DeploymentFrequency
- Includes:
- Gitlab::CycleAnalytics::SummaryHelper
- Defined in:
- lib/gitlab/cycle_analytics/summary/deployment_frequency.rb
Instance Method Summary collapse
-
#initialize(deployments:, options:, project:) ⇒ DeploymentFrequency
constructor
A new instance of DeploymentFrequency.
- #links ⇒ Object
- #title ⇒ Object
- #unit ⇒ Object
- #value ⇒ Object
Methods included from Gitlab::CycleAnalytics::SummaryHelper
Methods included from Defaults
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: ) end |
Instance Method Details
#links ⇒ Object
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 |
#title ⇒ Object
15 16 17 |
# File 'lib/gitlab/cycle_analytics/summary/deployment_frequency.rb', line 15 def title _('Deployment Frequency') end |
#unit ⇒ Object
23 24 25 |
# File 'lib/gitlab/cycle_analytics/summary/deployment_frequency.rb', line 23 def unit _('/day') end |
#value ⇒ Object
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 |