Class: Gitlab::Analytics::CycleAnalytics::StageEvents::StageEvent

Inherits:
Object
  • Object
show all
Extended by:
Utils::Override
Includes:
CycleAnalytics::MetricsTables
Defined in:
lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb

Overview

Base class for expressing an event that can be used for a stage.

Class Method Summary collapse

Instance Method Summary collapse

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

#initialize(params) ⇒ StageEvent

Returns a new instance of StageEvent.


14
15
16
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb', line 14

def initialize(params)
  @params = params
end

Class Method Details

.identifierObject

Raises:

  • (NotImplementedError)

22
23
24
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb', line 22

def self.identifier
  raise NotImplementedError
end

.label_based?Boolean

Returns:

  • (Boolean)

48
49
50
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb', line 48

def self.label_based?
  false
end

.nameObject

Raises:

  • (NotImplementedError)

18
19
20
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb', line 18

def self.name
  raise NotImplementedError
end

Instance Method Details

#apply_query_customization(query) ⇒ Object

Optionally a StageEvent may apply additional filtering or join other tables on the base query.


44
45
46
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb', line 44

def apply_query_customization(query)
  query
end

#column_listObject

List of columns that are referenced in the `timestamp_projection` expression Example timestamp projection: COALESCE(issue_metrics.created_at, issue_metrics.updated_at) Expected column list: issue_metrics.created_at, issue_metrics.updated_at


39
40
41
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb', line 39

def column_list
  []
end

#object_typeObject

Raises:

  • (NotImplementedError)

26
27
28
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb', line 26

def object_type
  raise NotImplementedError
end

#timestamp_projectionObject

Each StageEvent must expose a timestamp or a timestamp like expression in order to build a range query. Example: get me all the Issue records between start event end end event

Raises:

  • (NotImplementedError)

32
33
34
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/stage_event.rb', line 32

def timestamp_projection
  raise NotImplementedError
end