Class: Gitlab::Analytics::CycleAnalytics::Average
- Inherits:
-
Object
- Object
- Gitlab::Analytics::CycleAnalytics::Average
- Includes:
- StageQueryHelpers, Utils::StrongMemoize
- Defined in:
- lib/gitlab/analytics/cycle_analytics/average.rb
Instance Method Summary collapse
- #days ⇒ Object
-
#initialize(stage:, query:, params: {}) ⇒ Average
constructor
A new instance of Average.
- #seconds ⇒ Object
Methods included from StageQueryHelpers
#duration, #end_event_timestamp_projection, #execute_query, #in_progress?, #order_by, #requires_grouping?, #round_duration_to_seconds, #zero_interval
Constructor Details
#initialize(stage:, query:, params: {}) ⇒ Average
Returns a new instance of Average.
10 11 12 13 14 |
# File 'lib/gitlab/analytics/cycle_analytics/average.rb', line 10 def initialize(stage:, query:, params: {}) @stage = stage @query = query @params = params end |
Instance Method Details
#days ⇒ Object
20 21 22 |
# File 'lib/gitlab/analytics/cycle_analytics/average.rb', line 20 def days seconds ? seconds.fdiv(1.day) : nil end |
#seconds ⇒ Object
16 17 18 |
# File 'lib/gitlab/analytics/cycle_analytics/average.rb', line 16 def seconds select_average ? select_average['average'] : nil end |