gitlab-org--gitlab-foss/spec/services/projects
Yorick Peterse 6ec53f5d48
Cache the number of open issues and merge requests
Every project page displays a navigation menu that in turn displays the
number of open issues and merge requests. This means that for every
project page we run two COUNT(*) queries, each taking up roughly 30
milliseconds on GitLab.com. By caching these numbers and refreshing them
whenever necessary we can reduce loading times of all these pages by up
to roughly 60 milliseconds.

The number of open issues does not include confidential issues. This is
a trade-off to keep the code simple and to ensure refreshing the data
only needs 2 COUNT(*) queries instead of 3. A downside is that if a
project only has 5 confidential issues the counter will be set to 0.

Because we now have 3 similar counting service classes the code
previously used in Projects::ForksCountService has mostly been moved to
Projects::CountService, which in turn is reused by the various service
classes.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36622
2017-08-23 13:42:29 +02:00
..
autocomplete_service_spec.rb Show group milestones in autocomplete 2017-08-07 11:55:01 +01:00
count_service_spec.rb Cache the number of open issues and merge requests 2017-08-23 13:42:29 +02:00
create_from_template_service_spec.rb After merge cleanup 2017-08-07 15:09:14 +02:00
create_service_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
destroy_service_spec.rb Fix positive raise_error expectation without specifying the error type expected in Project::DestroyService specs 2017-08-14 19:37:22 +01:00
download_service_spec.rb Change all :empty_project to :project 2017-08-02 17:47:31 -04:00
enable_deploy_key_service_spec.rb Change all :empty_project to :project 2017-08-02 17:47:31 -04:00
fork_service_spec.rb Cache the number of forks of a project 2017-08-14 18:00:28 +02:00
forks_count_service_spec.rb Cache the number of open issues and merge requests 2017-08-23 13:42:29 +02:00
housekeeping_service_spec.rb Enable the RSpec/HookArgument cop and auto-correct offenses 2017-08-10 19:29:42 -04:00
import_service_spec.rb Does not fetch repository when importing from GitHub on import service 2017-08-07 13:06:13 -03:00
open_issues_count_service_spec.rb Cache the number of open issues and merge requests 2017-08-23 13:42:29 +02:00
open_merge_requests_count_service_spec.rb Cache the number of open issues and merge requests 2017-08-23 13:42:29 +02:00
participants_service_spec.rb Change all :empty_project to :project 2017-08-02 17:47:31 -04:00
propagate_service_template_spec.rb Change all :empty_project to :project 2017-08-02 17:47:31 -04:00
transfer_service_spec.rb Rename path_with_namespace -> disk_path when dealing with the filesystem 2017-08-01 07:26:58 +02:00
unlink_fork_service_spec.rb Cache the number of forks of a project 2017-08-14 18:00:28 +02:00
update_pages_configuration_service_spec.rb Change all :empty_project to :project 2017-08-02 17:47:31 -04:00
update_pages_service_spec.rb Fix rubocop offense in update pages service specs 2017-07-25 13:47:03 +02:00
update_service_spec.rb Add checks for branch existence before changing HEAD 2017-08-08 12:10:55 +11:00