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
b6c24b62
Commit
b6c24b62
authored
Apr 06, 2022
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add note about RedisHLL metrics time range
parent
77cec6bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
lib/gitlab/usage_data_counters/hll_redis_counter.rb
lib/gitlab/usage_data_counters/hll_redis_counter.rb
+13
-0
No files found.
lib/gitlab/usage_data_counters/hll_redis_counter.rb
View file @
b6c24b62
...
...
@@ -81,6 +81,12 @@ module Gitlab
track
(
values
,
event_name
,
context:
context
,
time:
time
)
end
# Count unique events for a givend time range.
#
# event_names - The list of the events to count.
# start_date - The start date of the time range.
# end_date - The end date of the time range.
# context - Event context, plan level tracking. Available if set when tracking.
def
unique_events
(
event_names
:,
start_date
:,
end_date
:,
context:
''
)
count_unique_events
(
event_names:
event_names
,
start_date:
start_date
,
end_date:
end_date
,
context:
context
)
do
|
events
|
raise
SlotMismatch
,
events
unless
events_in_same_slot?
(
events
)
...
...
@@ -100,6 +106,13 @@ module Gitlab
known_events
.
select
{
|
event
|
event
[
:category
]
==
category
.
to_s
}.
map
{
|
event
|
event
[
:name
]
}
end
# Recent 7 or 28 days unique events data for events definited in /lib/gitlab/usage_data_counters/known_events/
#
# - For metrics for which we store a key per day, we have the last 7 days or last 28 days of data.
# - For metrics for which we store a key per week we have the last complete week or last 4 complete weeks
# daily or weekly information is in the file we have for events definition /lib/gitlab/usage_data_counters/known_events/
# - Most of the metrics have weekly aggregation, we recommend this as it generates less keys in redis to store.
# - The aggregation used doesn't affect data granulation.
def
unique_events_data
categories
.
each_with_object
({})
do
|
category
,
category_results
|
events_names
=
events_for_category
(
category
)
...
...
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