Track and act upon the number of executed SQL queries
What does this MR do?
This MR introduces a mechanism for measuring the number of executed SQL queries and alerting should this number exceed a given threshold. In a test environment exceeding the threshold (100 at the moment) will result in an exception being generated. In production/development environments we instead report the problem in Sentry (if enabled).
As part of this MR a variety of controllers have been allowlisted based on which tests failed with this system in place. For every allowlisted controller (action) an issue has been created to resolve those problems.
EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4255
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug - Review
-
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together
What are the relevant issue numbers?
Edited by Chad Woolley