diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-16 21:57:32 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-21 21:57:09 +0300 |
commit | 06fd2879ee4f5936e0be9744cbd208079f2542bd (patch) | |
tree | 328fdb910c4c6d03f35c744feb63cc9c6956e812 /app/controllers/projects/cycle_analytics_controller.rb | |
parent | ee6b991f0b16e55009288b72a46204c23b08654b (diff) |
Provide stage legend on server response
Diffstat (limited to 'app/controllers/projects/cycle_analytics_controller.rb')
-rw-r--r-- | app/controllers/projects/cycle_analytics_controller.rb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/app/controllers/projects/cycle_analytics_controller.rb b/app/controllers/projects/cycle_analytics_controller.rb index 4caec91efe7..2fb496053a5 100644 --- a/app/controllers/projects/cycle_analytics_controller.rb +++ b/app/controllers/projects/cycle_analytics_controller.rb @@ -29,15 +29,15 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController def generate_cycle_analytics_data stats_values = [] - cycle_analytics_view_data = [[:issue, "Issue", "Time before an issue gets scheduled"], - [:plan, "Plan", "Time before an issue starts implementation"], - [:code, "Code", "Time until first merge request"], - [:test, "Test", "Total test time for all commits/merges"], - [:review, "Review", "Time between merge request creation and merge/close"], - [:staging, "Staging", "From merge request merge until deploy to production"], - [:production, "Production", "From issue creation until deploy to production"]] - - stats = cycle_analytics_view_data.reduce([]) do |stats, (stage_method, stage_text, stage_description)| + cycle_analytics_view_data = [[:issue, "Issue", "Related Issues", "Time before an issue gets scheduled"], + [:plan, "Plan", "Related Commits", "Time before an issue starts implementation"], + [:code, "Code", "Related Merge Requests", "Time until first merge request"], + [:test, "Test", "Relative Builds Trigger by Commits", "Total test time for all commits/merges"], + [:review, "Review", "Relative Merged Requests", "Time between merge request creation and merge/close"], + [:staging, "Staging", "Relative Deployed Builds", "From merge request merge until deploy to production"], + [:production, "Production", "Related Issues", "From issue creation until deploy to production"]] + + stats = cycle_analytics_view_data.reduce([]) do |stats, (stage_method, stage_text, stage_legend, stage_description)| value = @cycle_analytics.send(stage_method).presence stats_values << value.abs if value @@ -45,6 +45,7 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController stats << { title: stage_text, description: stage_description, + legend: stage_legend, value: value && !value.zero? ? distance_of_time_in_words(value) : nil } |