Module: Analytics::CycleAnalytics::StageActions

Extended by:
ActiveSupport::Concern
Includes:
Gitlab::Utils::StrongMemoize
Included in:
Projects::Analytics::CycleAnalytics::StagesController
Defined in:
app/controllers/concerns/analytics/cycle_analytics/stage_actions.rb

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Instance Method Details

#averageObject


29
30
31
# File 'app/controllers/concerns/analytics/cycle_analytics/stage_actions.rb', line 29

def average
  render json: { value: data_collector.average.seconds }
end

#countObject


41
42
43
# File 'app/controllers/concerns/analytics/cycle_analytics/stage_actions.rb', line 41

def count
  render json: { count: data_collector.count }
end

#indexObject


15
16
17
18
19
20
21
22
23
# File 'app/controllers/concerns/analytics/cycle_analytics/stage_actions.rb', line 15

def index
  result = list_service.execute

  if result.success?
    render json: cycle_analytics_configuration(result.payload[:stages])
  else
    render json: { message: result.message }, status: result.http_status
  end
end

#medianObject


25
26
27
# File 'app/controllers/concerns/analytics/cycle_analytics/stage_actions.rb', line 25

def median
  render json: { value: data_collector.median.seconds }
end

#recordsObject


33
34
35
36
37
38
39
# File 'app/controllers/concerns/analytics/cycle_analytics/stage_actions.rb', line 33

def records
  serialized_records = data_collector.serialized_records do |relation|
    add_pagination_headers(relation)
  end

  render json: serialized_records
end