summaryrefslogtreecommitdiff
path: root/app/models/cycle_analytics/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/cycle_analytics/base.rb')
-rw-r--r--app/models/cycle_analytics/base.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/app/models/cycle_analytics/base.rb b/app/models/cycle_analytics/base.rb
index 240be10c1f9..d7b28cd1b67 100644
--- a/app/models/cycle_analytics/base.rb
+++ b/app/models/cycle_analytics/base.rb
@@ -4,14 +4,16 @@ module CycleAnalytics
class Base
STAGES = %i[issue plan code test review staging production].freeze
- def all_medians_per_stage
+ def all_medians_by_stage
STAGES.each_with_object({}) do |stage_name, medians_per_stage|
medians_per_stage[stage_name] = self[stage_name].median
end
end
def stats
- @stats ||= stats_per_stage
+ @stats ||= STAGES.map do |stage_name|
+ self[stage_name].as_json
+ end
end
def no_stats?
@@ -21,13 +23,5 @@ module CycleAnalytics
def [](stage_name)
Gitlab::CycleAnalytics::Stage[stage_name].new(project: @project, options: @options)
end
-
- private
-
- def stats_per_stage
- STAGES.map do |stage_name|
- self[stage_name].as_json
- end
- end
end
end