Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/search.rb')
-rw-r--r--lib/api/search.rb17
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?