database_query_analyzers.rb 371 Bytes
Newer Older
1 2 3
# frozen_string_literal: true

# Currently we register validator only for `dev` or `test` environment
4 5
if Gitlab.dev_or_test_env? || Gitlab::Utils.to_boolean('GITLAB_ENABLE_QUERY_ANALYZERS', default: false)
  Gitlab::Database::QueryAnalyzer.instance.hook!
6 7 8 9

  Gitlab::Application.configure do |config|
    config.middleware.use(Gitlab::Middleware::QueryAnalyzer)
  end
10
end