##// END OF EJS Templates
scm: git: performance improvements in fetching revisions (#8857, #9472)...
scm: git: performance improvements in fetching revisions (#8857, #9472) Parse a revision for a given branch, just if we haven't parsed it for any branches before. Moved the db check to for existing revisions into a grouped search. Search for many revisions at once: this reduces db load. Revisions are grouped into sets of 100. This is to improve memory consumption. There will be just one query instead of each 100. The above two methods significantly increase parsing speed. Test case was a git repo with 6000+ commits on a master branch, and several other branches originating for master. Speed improved from 1.4h to 18min. Contributed by Gergely Fábián. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9144 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r6687:4ed5041965b7
r9024:999a4ba30d7b
Show More
reports_controller.rb
95 lines | 3.3 KiB | text/x-ruby | RubyLexer
/ app / controllers / reports_controller.rb
Jean-Philippe Lang
Ability to assign issues to groups (#2964)....
r6186 # Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/reports_controller.rb....
r6687 #
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/reports_controller.rb....
r6687 #
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class ReportsController < ApplicationController
Jean-Philippe Lang
Highlight the current item of the main menu....
r1062 menu_item :issues
Eric Davis
Refactored IssueStatus finder to a before_filter...
r3296 before_filter :find_project, :authorize, :find_issue_statuses
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330
def issue_report
Eric Davis
Separated ReportsController#issue_report into two separate actions....
r3282 @trackers = @project.trackers
@versions = @project.shared_versions.sort
@priorities = IssuePriority.all
@categories = @project.issue_categories
Jean-Philippe Lang
Ability to assign issues to groups (#2964)....
r6186 @assignees = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort
@authors = @project.users.sort
Jean-Philippe Lang
Fixed: private subprojects names may be revealed on issue summary report (#5360)....
r3578 @subprojects = @project.descendants.visible
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290
@issues_by_tracker = Issue.by_tracker(@project)
@issues_by_version = Issue.by_version(@project)
@issues_by_priority = Issue.by_priority(@project)
@issues_by_category = Issue.by_category(@project)
@issues_by_assigned_to = Issue.by_assigned_to(@project)
@issues_by_author = Issue.by_author(@project)
@issues_by_subproject = Issue.by_subproject(@project) || []
Eric Davis
Separated ReportsController#issue_report into two separate actions....
r3282 render :template => "reports/issue_report"
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/reports_controller.rb....
r6687 end
Eric Davis
Separated ReportsController#issue_report into two separate actions....
r3282
def issue_report_details
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 case params[:detail]
when "tracker"
@field = "tracker_id"
Jean-Philippe Lang
Added per-project tracker selection. Trackers can be selected on project settings....
r907 @rows = @project.trackers
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_tracker(@project)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 @report_title = l(:field_tracker)
Jean-Philippe Lang
Added issue count details for versions on Reports view....
r540 when "version"
@field = "fixed_version_id"
Jean-Philippe Lang
Display shared versions on the issue summary view (#4425)....
r3073 @rows = @project.shared_versions.sort
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_version(@project)
Jean-Philippe Lang
Added issue count details for versions on Reports view....
r540 @report_title = l(:field_version)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 when "priority"
@field = "priority_id"
Eric Davis
Changed Enumerations to use a Single Table Inheritance...
r2677 @rows = IssuePriority.all
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_priority(@project)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 @report_title = l(:field_priority)
when "category"
@field = "category_id"
@rows = @project.issue_categories
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_category(@project)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 @report_title = l(:field_category)
Jean-Philippe Lang
Added details by assignees on issue summary view (Hans Yoon)....
r1038 when "assigned_to"
@field = "assigned_to_id"
Jean-Philippe Lang
Ability to assign issues to groups (#2964)....
r6186 @rows = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_assigned_to(@project)
Jean-Philippe Lang
Added details by assignees on issue summary view (Hans Yoon)....
r1038 @report_title = l(:field_assigned_to)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 when "author"
@field = "author_id"
Jean-Philippe Lang
Ability to assign issues to groups (#2964)....
r6186 @rows = @project.users.sort
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_author(@project)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 @report_title = l(:field_author)
Jean-Philippe Lang
Added subprojects issue count on project "Reports" page...
r407 when "subproject"
@field = "project_id"
Jean-Philippe Lang
Fixed: private subprojects names may be revealed on issue summary report (#5360)....
r3578 @rows = @project.descendants.visible
Eric Davis
Refactor: inline the utility methods in ReportsController....
r3290 @data = Issue.by_subproject(@project) || []
Jean-Philippe Lang
Added subprojects issue count on project "Reports" page...
r407 @report_title = l(:field_subproject)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 end
Eric Davis
Separated ReportsController#issue_report into two separate actions....
r3282
Eric Davis
Extracted the rendering from each case statement in issue_reports_details...
r3287 respond_to do |format|
if @field
format.html {}
else
format.html { redirect_to :action => 'issue_report', :id => @project }
end
end
Eric Davis
Separated ReportsController#issue_report into two separate actions....
r3282 end
Jean-Philippe Lang
Added issue count details for versions on Reports view....
r540
Eric Davis
Refactored IssueStatus finder to a before_filter...
r3296 private
def find_issue_statuses
@statuses = IssueStatus.find(:all, :order => 'position')
end
Jean-Philippe Lang
Initial commit...
r2 end