gitlab-org--gitlab-foss/spec/workers
Yorick Peterse 237c8f66e6
Precalculate trending projects
This commit introduces a Sidekiq worker that precalculates the list of
trending projects on a daily basis. The resulting set is stored in a
database table that is then queried by Project.trending.

This setup means that Unicorn workers no longer _may_ have to calculate
the list of trending projects. Furthermore it supports filtering without
any complex caching mechanisms.

The data in the "trending_projects" table is inserted in the same order
as the project ranking. This means that getting the projects in the
correct order is simply a matter of:

    SELECT projects.*
    FROM projects
    INNER JOIN trending_projects ON trending_projects.project_id = projects.id
    ORDER BY trending_projects.id ASC;

Such a query will only take a few milliseconds at most (as measured on
GitLab.com), opposed to a few seconds for the query used for calculating
the project ranks.

The migration in this commit does not require downtime and takes care of
populating an initial list of trending projects.
2016-10-10 12:27:08 +02:00
..
repository_check Project tools visibility level 2016-09-01 11:47:59 -03:00
build_email_worker_spec.rb Simplify the name for data builder, feedback: 2016-08-12 16:09:29 +08:00
delete_user_worker_spec.rb
email_receiver_worker_spec.rb
emails_on_push_worker_spec.rb Don't log to STDOUT in specs 2016-08-19 13:08:21 +01:00
expire_build_artifacts_worker_spec.rb ExpireBuildArtifactsWorker query builds table without ordering enqueuing one job per build to cleanup 2016-10-07 15:33:58 +02:00
expire_build_instance_artifacts_worker_spec.rb ExpireBuildArtifactsWorker query builds table without ordering enqueuing one job per build to cleanup 2016-10-07 15:33:58 +02:00
git_garbage_collect_worker_spec.rb Refresh branch cache after `git gc` 2016-07-13 06:49:58 -07:00
group_destroy_worker_spec.rb Fix bug where destroying a namespace would not always destroy projects 2016-08-11 15:36:35 -07:00
merge_worker_spec.rb Unify check branch name exist 2016-06-20 21:44:21 +02:00
post_receive_spec.rb Refactor Gitlab::Identifier 2016-10-05 12:40:17 +02:00
process_pipeline_worker_spec.rb Add specs for new async ci pipeline workers 2016-10-04 14:43:58 +02:00
project_cache_worker_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
project_destroy_worker_spec.rb Fix skip_repo parameter being ignored when destroying a namespace 2016-08-03 17:07:38 -07:00
prune_old_events_worker_spec.rb Added cron to prune events older than 12 months. 2016-09-07 19:41:25 +02:00
remove_expired_group_links_worker_spec.rb Allow project group links to be expired 2016-08-18 22:45:41 +01:00
remove_expired_members_worker_spec.rb Allow project group links to be expired 2016-08-18 22:45:41 +01:00
repository_fork_worker_spec.rb Fix a bug where forking a project from a repository storage to another would fail 2016-07-26 17:22:13 -04:00
repository_import_worker_spec.rb
stuck_ci_builds_worker_spec.rb
trending_projects_worker_spec.rb Precalculate trending projects 2016-10-10 12:27:08 +02:00
update_pipeline_worker_spec.rb Add specs for new async ci pipeline workers 2016-10-04 14:43:58 +02:00