2021-11-08 12:12:07 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Currently we register validator only for `dev` or `test` environment
|
2021-11-10 03:10:14 +00:00
|
|
|
if Gitlab.dev_or_test_env? || Gitlab::Utils.to_boolean(ENV['GITLAB_ENABLE_QUERY_ANALYZERS'], default: false)
|
|
|
|
Gitlab::Database::QueryAnalyzer.instance.hook!
|
2021-11-15 12:11:17 +00:00
|
|
|
Gitlab::Database::QueryAnalyzer.instance.all_analyzers.append(::Gitlab::Database::QueryAnalyzers::GitlabSchemasMetrics)
|
2021-11-10 12:10:12 +00:00
|
|
|
|
|
|
|
Gitlab::Application.configure do |config|
|
|
|
|
config.middleware.use(Gitlab::Middleware::QueryAnalyzer)
|
|
|
|
end
|
2021-11-10 03:10:14 +00:00
|
|
|
end
|