diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-01-15 18:21:04 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-02-01 19:00:46 +0300 |
commit | cca61980d5ad9c4db65b9498fe49d936657bc0e2 (patch) | |
tree | 1a844c4121c0530ea35f29d035e65a16be6e491a /app/controllers/projects/cycle_analytics_controller.rb | |
parent | 5b73e0eb35f5b9b78c228a4867ef78538ef05653 (diff) |
Track and act upon the number of executed queries
This ensures that we have more visibility in the number of SQL queries
that are executed in web requests. The current threshold is hardcoded to
100 as we will rarely (maybe once or twice) change it.
In production and development we use Sentry if enabled, in the test
environment we raise an error. This feature is also only enabled in
production/staging when running on GitLab.com as it's not very useful to
other users.
Diffstat (limited to 'app/controllers/projects/cycle_analytics_controller.rb')
-rw-r--r-- | app/controllers/projects/cycle_analytics_controller.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/projects/cycle_analytics_controller.rb b/app/controllers/projects/cycle_analytics_controller.rb index 88ac3ad046b..d1b8fd80c4e 100644 --- a/app/controllers/projects/cycle_analytics_controller.rb +++ b/app/controllers/projects/cycle_analytics_controller.rb @@ -3,6 +3,7 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController include ActionView::Helpers::TextHelper include CycleAnalyticsParams + before_action :whitelist_query_limiting, only: [:show] before_action :authorize_read_cycle_analytics! def show @@ -31,4 +32,8 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController permissions: @cycle_analytics.permissions(user: current_user) } end + + def whitelist_query_limiting + Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42671') + end end |