diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-01-30 11:28:15 +0000 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-02-28 10:46:19 +0000 |
commit | a7b3f11edd626b7ba2fe4101951d2c9fe884b04a (patch) | |
tree | d3f63140f355976608830af8ea9c2b4f16ba1330 /app/models/cycle_analytics.rb | |
parent | 4371f845649deaf6bf31f0a675b33f1d58f64de4 (diff) | |
download | gitlab-ce-a7b3f11edd626b7ba2fe4101951d2c9fe884b04a.tar.gz |
Adds get all medians to Cycle Analytics model
Diffstat (limited to 'app/models/cycle_analytics.rb')
-rw-r--r-- | app/models/cycle_analytics.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/cycle_analytics.rb b/app/models/cycle_analytics.rb index d2e626c22e8..a6191e569a7 100644 --- a/app/models/cycle_analytics.rb +++ b/app/models/cycle_analytics.rb @@ -6,6 +6,12 @@ class CycleAnalytics @options = options end + def self.all_medians_per_stage(projects, options) + STAGES.each_with_object({}) do |stage_name, hsh| + hsh[stage_name] = Gitlab::CycleAnalytics::Stage[stage_name].new(projects: projects, options: options).medians&.values || [] + end + end + def summary @summary ||= ::Gitlab::CycleAnalytics::StageSummary.new(@project, from: @options[:from], |