diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /lib/api/search.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'lib/api/search.rb')
-rw-r--r-- | lib/api/search.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/api/search.rb b/lib/api/search.rb index 7aa3cf8a5cb..44bb4228786 100644 --- a/lib/api/search.rb +++ b/lib/api/search.rb @@ -65,9 +65,26 @@ module API set_global_search_log_information + Gitlab::Metrics::GlobalSearchSlis.record_apdex( + elapsed: @search_duration_s, + search_type: search_type, + search_level: search_service.level, + search_scope: search_scope + ) + Gitlab::UsageDataCounters::SearchCounter.count(:all_searches) paginate(@results) + + ensure + # If we raise an error somewhere in the @search_duration_s benchmark block, we will end up here + # with a 200 status code, but an empty @search_duration_s. + Gitlab::Metrics::GlobalSearchSlis.record_error_rate( + error: @search_duration_s.nil? || (status < 200 || status >= 400), + search_type: search_type, + search_level: search_service(additional_params).level, + search_scope: search_scope + ) end def snippets? |