Welcome to mirror list, hosted at ThFree Co, Russian Federation.

search_counter.rb « usage_data_counters « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 46aec52b95a51d8f10a4377bd25924cab991a3a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module Gitlab
  module UsageDataCounters
    class SearchCounter < BaseCounter
      KNOWN_EVENTS = %w[all_searches navbar_searches].freeze
      PREFIX = nil

      class << self
        def redis_key(event)
          require_known_event(event)

          "#{event}_COUNT".upcase
        end

        private

        def counter_key(event)
          "#{event}".to_sym
        end
      end
    end
  end
end