blob: b9e3a5c01044b4cc009839133dbba26a32c5e27c (
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
25
26
27
28
29
30
31
|
# frozen_string_literal: true
module Gitlab
module UsageDataCounters
class SearchCounter
extend RedisCounter
NAVBAR_SEARCHES_COUNT_KEY = 'NAVBAR_SEARCHES_COUNT'
class << self
def increment_navbar_searches_count
increment(NAVBAR_SEARCHES_COUNT_KEY)
end
def total_navbar_searches_count
total_count(NAVBAR_SEARCHES_COUNT_KEY)
end
def totals
{
navbar_searches: total_navbar_searches_count
}
end
def fallback_totals
{ navbar_searches: -1 }
end
end
end
end
end
|