summaryrefslogtreecommitdiff
path: root/app/controllers/projects
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-06-22 14:37:59 +0200
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-06-23 11:46:55 +0200
commit13d39971f33e4064bd5c8da1865cc874e1005e52 (patch)
tree8f4563162e928b52eb638e7d9e3e0987c53a5115 /app/controllers/projects
parent9c7bf123564ee3c045c2aa3625f8a691f91a23aa (diff)
downloadgitlab-ce-13d39971f33e4064bd5c8da1865cc874e1005e52.tar.gz
Improve performance for pipeline charts
Achieved by using another table, which both has better indexes and is smaller. Now the data provided for the user is more valueable too.
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/pipelines_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index 8effb792689..d1bb85d5b73 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -136,6 +136,11 @@ class Projects::PipelinesController < Projects::ApplicationController
@charts[:month] = Ci::Charts::MonthChart.new(project)
@charts[:year] = Ci::Charts::YearChart.new(project)
@charts[:build_times] = Ci::Charts::BuildTime.new(project)
+
+ @counts = {}
+ @counts[:total] = @project.pipelines.count(:all)
+ @counts[:success] = @project.pipelines.success.count(:all)
+ @counts[:failed] = @project.pipelines.failed.count(:all)
end
private