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