Class: Gitlab::CycleAnalytics::BaseEventFetcher
- Inherits:
-
Object
- Object
- Gitlab::CycleAnalytics::BaseEventFetcher
- Includes:
- BaseQuery, GroupProjectsProvider
- Defined in:
- lib/gitlab/cycle_analytics/base_event_fetcher.rb
Direct Known Subclasses
CodeEventFetcher, IssueEventFetcher, PlanEventFetcher, ProductionEventFetcher, ReviewEventFetcher, StagingEventFetcher, TestEventFetcher
Constant Summary collapse
- MAX_EVENTS =
50
Constants included from Database::Median
Database::Median::NotSupportedError
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#projections ⇒ Object
readonly
Returns the value of attribute projections.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#stage ⇒ Object
readonly
Returns the value of attribute stage.
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(stage:, options:) ⇒ BaseEventFetcher
constructor
A new instance of BaseEventFetcher.
- #order ⇒ Object
Methods included from GroupProjectsProvider
Methods included from Database::DateTime
#subtract_datetimes, #subtract_datetimes_diff
Methods included from Database::Median
#extract_median, #extract_medians, #median_datetime, #median_datetimes, #pg_median_datetime_sql
Methods included from 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(stage:, options:) ⇒ BaseEventFetcher
Returns a new instance of BaseEventFetcher.
13 14 15 16 |
# File 'lib/gitlab/cycle_analytics/base_event_fetcher.rb', line 13 def initialize(stage:, options:) @stage = stage @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options
9 10 11 |
# File 'lib/gitlab/cycle_analytics/base_event_fetcher.rb', line 9 def @options end |
#projections ⇒ Object (readonly)
Returns the value of attribute projections
9 10 11 |
# File 'lib/gitlab/cycle_analytics/base_event_fetcher.rb', line 9 def projections @projections end |
#query ⇒ Object (readonly)
Returns the value of attribute query
9 10 11 |
# File 'lib/gitlab/cycle_analytics/base_event_fetcher.rb', line 9 def query @query end |
#stage ⇒ Object (readonly)
Returns the value of attribute stage
9 10 11 |
# File 'lib/gitlab/cycle_analytics/base_event_fetcher.rb', line 9 def stage @stage end |
Instance Method Details
#fetch ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/gitlab/cycle_analytics/base_event_fetcher.rb', line 18 def fetch event_result.map do |event| serialize(event) if (event['id']) end.compact end |
#order ⇒ Object
26 27 28 |
# File 'lib/gitlab/cycle_analytics/base_event_fetcher.rb', line 26 def order @order || default_order end |