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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
441 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
2021-02-22 17:27:13 +05:30
PREFIX = nil
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