Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
be499b69
Commit
be499b69
authored
Sep 15, 2020
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use redis_usage_data for redis_hll_counters
parent
1922007e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lib/gitlab/usage_data_counters/hll_redis_counter.rb
lib/gitlab/usage_data_counters/hll_redis_counter.rb
+3
-3
No files found.
lib/gitlab/usage_data_counters/hll_redis_counter.rb
View file @
be499b69
...
...
@@ -3,8 +3,6 @@
module
Gitlab
module
UsageDataCounters
module
HLLRedisCounter
include
Gitlab
::
Utils
::
UsageData
DEFAULT_WEEKLY_KEY_EXPIRY_LENGTH
=
6
.
weeks
DEFAULT_DAILY_KEY_EXPIRY_LENGTH
=
29
.
days
DEFAULT_REDIS_SLOT
=
''
.
freeze
...
...
@@ -33,6 +31,8 @@ module Gitlab
# * Track event: Gitlab::UsageDataCounters::HLLRedisCounter.track_event(user_id, 'g_compliance_dashboard')
# * Get unique counts per user: Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: 'g_compliance_dashboard', start_date: 28.days.ago, end_date: Date.current)
class
<<
self
include
Gitlab
::
Utils
::
UsageData
def
track_event
(
entity_id
,
event_name
,
time
=
Time
.
zone
.
now
)
return
unless
Gitlab
::
CurrentSettings
.
usage_ping_enabled?
...
...
@@ -54,7 +54,7 @@ module Gitlab
keys
=
keys_for_aggregation
(
aggregation
,
events:
events
,
start_date:
start_date
,
end_date:
end_date
)
Gitlab
::
Redis
::
HLL
.
count
(
keys:
keys
)
redis_usage_data
{
Gitlab
::
Redis
::
HLL
.
count
(
keys:
keys
)
}
end
def
categories
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment