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
2a12a250
Commit
2a12a250
authored
Nov 23, 2021
by
Luis Mejia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redis_hll_tracking validation from usage_data
parent
848f1fbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
23 deletions
+9
-23
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+0
-2
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+9
-21
No files found.
lib/gitlab/usage_data.rb
View file @
2a12a250
...
...
@@ -663,8 +663,6 @@ module Gitlab
end
def
redis_hll_counters
return
{}
unless
Feature
.
enabled?
(
:redis_hll_tracking
,
type: :ops
,
default_enabled: :yaml
)
{
redis_hll_counters:
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
unique_events_data
}
end
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
2a12a250
...
...
@@ -1402,33 +1402,21 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
let
(
:categories
)
{
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
categories
}
context
'with redis_hll_tracking feature enabled'
do
it
'has all known_events'
do
stub_feature_flags
(
redis_hll_tracking:
true
)
it
'has all known_events'
do
expect
(
subject
).
to
have_key
(
:redis_hll_counters
)
expect
(
subject
).
to
have_key
(
:redis_hll_counter
s
)
expect
(
subject
[
:redis_hll_counters
].
keys
).
to
match_array
(
categorie
s
)
expect
(
subject
[
:redis_hll_counters
].
keys
).
to
match_array
(
categories
)
categories
.
each
do
|
category
|
keys
=
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
events_for_category
(
category
)
categories
.
each
do
|
category
|
keys
=
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
events_for_category
(
category
)
metrics
=
keys
.
map
{
|
key
|
"
#{
key
}
_weekly"
}
+
keys
.
map
{
|
key
|
"
#{
key
}
_monthly"
}
metrics
=
keys
.
map
{
|
key
|
"
#{
key
}
_weekly"
}
+
keys
.
map
{
|
key
|
"
#{
key
}
_monthly"
}
if
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
::
CATEGORIES_FOR_TOTALS
.
include?
(
category
)
metrics
.
append
(
"
#{
category
}
_total_unique_counts_weekly"
,
"
#{
category
}
_total_unique_counts_monthly"
)
end
expect
(
subject
[
:redis_hll_counters
][
category
].
keys
).
to
match_array
(
metrics
)
if
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
::
CATEGORIES_FOR_TOTALS
.
include?
(
category
)
metrics
.
append
(
"
#{
category
}
_total_unique_counts_weekly"
,
"
#{
category
}
_total_unique_counts_monthly"
)
end
end
end
context
'with redis_hll_tracking disabled'
do
it
'does not have redis_hll_tracking key'
do
stub_feature_flags
(
redis_hll_tracking:
false
)
expect
(
subject
).
not_to
have_key
(
:redis_hll_counter
s
)
expect
(
subject
[
:redis_hll_counters
][
category
].
keys
).
to
match_array
(
metric
s
)
end
end
end
...
...
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