gitlab-org--gitlab-foss/lib/gitlab/usage_data_counters/search_counter.rb
Francisco Javier López 26e9efc011 Added navbar searches usage ping counter
Added usage ping counter when the user makes
a search through the navbar search component.
2019-07-29 09:58:58 +00:00

27 lines
548 B
Ruby

# frozen_string_literal: true
module Gitlab
module UsageDataCounters
class SearchCounter
extend RedisCounter
NAVBAR_SEARCHES_COUNT_KEY = 'NAVBAR_SEARCHES_COUNT'
class << self
def increment_navbar_searches_count
increment(NAVBAR_SEARCHES_COUNT_KEY)
end
def total_navbar_searches_count
total_count(NAVBAR_SEARCHES_COUNT_KEY)
end
def totals
{
navbar_searches: total_navbar_searches_count
}
end
end
end
end
end