Class: Gitlab::Analytics::CycleAnalytics::StageEvents::ProductionStageEnd

Inherits:
StageEvent
  • Object
show all
Defined in:
lib/gitlab/analytics/cycle_analytics/stage_events/production_stage_end.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from StageEvent

#initialize, label_based?

Methods included from Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods included from CycleAnalytics::MetricsTables

#build_table, #issue_metrics_table, #issue_table, #mr_closing_issues_table, #mr_diff_commits_table, #mr_diff_table, #mr_metrics_table, #mr_table, #projects_table, #routes_table, #user_table

Constructor Details

This class inherits a constructor from Gitlab::Analytics::CycleAnalytics::StageEvents::StageEvent

Class Method Details

.identifierObject


12
13
14
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/production_stage_end.rb', line 12

def self.identifier
  :production_stage_end
end

.nameObject


8
9
10
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/production_stage_end.rb', line 8

def self.name
  _("Issue first depoloyed to production")
end

Instance Method Details

#apply_query_customization(query) ⇒ Object

rubocop: disable CodeReuse/ActiveRecord


30
31
32
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/production_stage_end.rb', line 30

def apply_query_customization(query)
  query.joins(merge_requests_closing_issues: { merge_request: [:metrics] }).where(mr_metrics_table[:first_deployed_to_production_at].gteq(mr_table[:created_at]))
end

#column_listObject


25
26
27
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/production_stage_end.rb', line 25

def column_list
  [timestamp_projection]
end

#object_typeObject


16
17
18
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/production_stage_end.rb', line 16

def object_type
  Issue
end

#timestamp_projectionObject


20
21
22
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/production_stage_end.rb', line 20

def timestamp_projection
  mr_metrics_table[:first_deployed_to_production_at]
end