summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2016-07-15 17:46:39 +0200
committerAhmad Sherif <me@ahmadsherif.com>2016-07-26 20:06:09 +0200
commit345cd22f21e4e5a6e340c35e50b43105ee107570 (patch)
treed1f3916535c9bca94cb9c8fe16559332dcbf762e /config
parent0c799be6b6fc0166473c82039ebf662a0558ed8f (diff)
downloadgitlab-ce-345cd22f21e4e5a6e340c35e50b43105ee107570.tar.gz
Profile requests when a header is passedfeature/profile-requests-conditionally
Diffstat (limited to 'config')
-rw-r--r--config/initializers/1_settings.rb3
-rw-r--r--config/initializers/request_profiler.rb3
-rw-r--r--config/routes.rb1
3 files changed, 7 insertions, 0 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 86f55210487..49130f37b31 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -290,6 +290,9 @@ Settings.cron_jobs['repository_archive_cache_worker']['job_class'] = 'Repository
Settings.cron_jobs['gitlab_remove_project_export_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['gitlab_remove_project_export_worker']['cron'] ||= '0 * * * *'
Settings.cron_jobs['gitlab_remove_project_export_worker']['job_class'] = 'GitlabRemoveProjectExportWorker'
+Settings.cron_jobs['requests_profiles_worker'] ||= Settingslogic.new({})
+Settings.cron_jobs['requests_profiles_worker']['cron'] ||= '0 0 * * *'
+Settings.cron_jobs['requests_profiles_worker']['job_class'] = 'RequestsProfilesWorker'
#
# GitLab Shell
diff --git a/config/initializers/request_profiler.rb b/config/initializers/request_profiler.rb
new file mode 100644
index 00000000000..fb5a7b8372e
--- /dev/null
+++ b/config/initializers/request_profiler.rb
@@ -0,0 +1,3 @@
+Rails.application.configure do |config|
+ config.middleware.use(Gitlab::RequestProfiler::Middleware)
+end
diff --git a/config/routes.rb b/config/routes.rb
index 21f3585bacd..a41a04a0b38 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -281,6 +281,7 @@ Rails.application.routes.draw do
resource :health_check, controller: 'health_check', only: [:show]
resource :background_jobs, controller: 'background_jobs', only: [:show]
resource :system_info, controller: 'system_info', only: [:show]
+ resources :requests_profiles, only: [:index, :show], param: :name
resources :namespaces, path: '/projects', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do
root to: 'projects#index', as: :projects