diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2019-07-29 12:58:58 +0300 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2019-07-29 12:58:58 +0300 |
commit | 26e9efc011c49b6918d4cc345a3328cabf22e2a7 (patch) | |
tree | 15076bcd7636cc4efc1421853245196a12fc2bdc /app/controllers/search_controller.rb | |
parent | 77926ea02512d836c61a30e3986902e2d8e7f886 (diff) |
Added navbar searches usage ping counter
Added usage ping counter when the user makes
a search through the navbar search component.
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r-- | app/controllers/search_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 8c674be58c5..13741548687 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -31,6 +31,8 @@ class SearchController < ApplicationController render_commits if @scope == 'commits' eager_load_user_status if @scope == 'users' + increment_navbar_searches_counter + check_single_commit_result end @@ -70,4 +72,10 @@ class SearchController < ApplicationController redirect_to project_commit_path(@project, only_commit) if found_by_commit_sha end end + + def increment_navbar_searches_counter + return if params[:nav_source] != 'navbar' + + Gitlab::UsageDataCounters::SearchCounter.increment_navbar_searches_count + end end |