debian-mirror-gitlab/lib/gitlab/usage_data_counters/search_counter.rb

24 lines
422 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
module Gitlab
module UsageDataCounters
2020-06-23 00:09:42 +05:30
class SearchCounter < BaseCounter
KNOWN_EVENTS = %w[all_searches navbar_searches].freeze
2019-10-12 21:52:04 +05:30
class << self
2020-06-23 00:09:42 +05:30
def redis_key(event)
require_known_event(event)
2019-10-12 21:52:04 +05:30
2020-06-23 00:09:42 +05:30
"#{event}_COUNT".upcase
2019-10-12 21:52:04 +05:30
end
2020-06-23 00:09:42 +05:30
private
2020-05-24 23:13:21 +05:30
2020-06-23 00:09:42 +05:30
def counter_key(event)
"#{event}".to_sym
2020-05-24 23:13:21 +05:30
end
2019-10-12 21:52:04 +05:30
end
end
end
end