2019-07-29 09:58:58 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module UsageDataCounters
|
2020-05-25 06:08:38 +00:00
|
|
|
class SearchCounter < BaseCounter
|
|
|
|
KNOWN_EVENTS = %w[all_searches navbar_searches].freeze
|
2019-07-29 09:58:58 +00:00
|
|
|
|
|
|
|
class << self
|
2020-05-25 06:08:38 +00:00
|
|
|
def redis_key(event)
|
|
|
|
require_known_event(event)
|
2019-07-29 09:58:58 +00:00
|
|
|
|
2020-05-25 06:08:38 +00:00
|
|
|
"#{event}_COUNT".upcase
|
2019-07-29 09:58:58 +00:00
|
|
|
end
|
|
|
|
|
2020-05-25 06:08:38 +00:00
|
|
|
private
|
2020-05-06 03:09:33 +00:00
|
|
|
|
2020-05-25 06:08:38 +00:00
|
|
|
def counter_key(event)
|
|
|
|
"#{event}".to_sym
|
2020-05-06 03:09:33 +00:00
|
|
|
end
|
2019-07-29 09:58:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|