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
973a431b
Commit
973a431b
authored
Dec 12, 2020
by
Mikolaj Wawrzyniak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature flag rollout
Remove product_analytics_aggregated_metrics feature flag
parent
cd3242a8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
48 deletions
+16
-48
changelogs/unreleased/mwaw-267550-product_analytics_aggregated_metrics-rollout.yml
...w-267550-product_analytics_aggregated_metrics-rollout.yml
+5
-0
config/feature_flags/development/product_analytics_aggregated_metrics.yml
...lags/development/product_analytics_aggregated_metrics.yml
+0
-8
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+0
-4
lib/gitlab/usage_data_counters/aggregated_metrics/common.yml
lib/gitlab/usage_data_counters/aggregated_metrics/common.yml
+0
-1
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+11
-35
No files found.
changelogs/unreleased/mwaw-267550-product_analytics_aggregated_metrics-rollout.yml
0 → 100644
View file @
973a431b
---
title
:
Add ability to aggregated metrics in Usage Ping
merge_request
:
49886
author
:
type
:
added
config/feature_flags/development/product_analytics_aggregated_metrics.yml
deleted
100644 → 0
View file @
cd3242a8
---
name
:
product_analytics_aggregated_metrics
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44624
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/267550
milestone
:
'
13.6'
type
:
development
group
:
group::product analytics
default_enabled
:
false
lib/gitlab/usage_data.rb
View file @
973a431b
...
...
@@ -689,16 +689,12 @@ module Gitlab
end
def
aggregated_metrics_monthly
return
{}
unless
Feature
.
enabled?
(
:product_analytics_aggregated_metrics
)
{
aggregated_metrics:
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
aggregated_metrics_monthly_data
}
end
def
aggregated_metrics_weekly
return
{}
unless
Feature
.
enabled?
(
:product_analytics_aggregated_metrics
)
{
aggregated_metrics:
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
aggregated_metrics_weekly_data
}
...
...
lib/gitlab/usage_data_counters/aggregated_metrics/common.yml
View file @
973a431b
...
...
@@ -11,7 +11,6 @@
-
name
:
product_analytics_test_metrics_union
operator
:
OR
events
:
[
'
i_search_total'
,
'
i_search_advanced'
,
'
i_search_paid'
]
feature_flag
:
product_analytics_aggregated_metrics
-
name
:
product_analytics_test_metrics_intersection
operator
:
AND
events
:
[
'
i_search_total'
,
'
i_search_advanced'
,
'
i_search_paid'
]
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
973a431b
...
...
@@ -1255,45 +1255,21 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
describe
'aggregated_metrics'
do
shared_examples
'aggregated_metrics_for_time_range'
do
context
'with product_analytics_aggregated_metrics feature flag on'
do
before
do
stub_feature_flags
(
product_analytics_aggregated_metrics:
true
)
end
it
'uses ::Gitlab::UsageDataCounters::HLLRedisCounter#aggregated_metrics_data'
,
:aggregate_failures
do
expect
(
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
).
to
receive
(
aggregated_metrics_data_method
).
and_return
(
global_search_gmau:
123
)
expect
(
aggregated_metrics_payload
).
to
eq
(
aggregated_metrics:
{
global_search_gmau:
123
})
end
end
context
'with product_analytics_aggregated_metrics feature flag off'
do
before
do
stub_feature_flags
(
product_analytics_aggregated_metrics:
false
)
end
describe
'.aggregated_metrics_weekly'
do
subject
(
:aggregated_metrics_payload
)
{
described_class
.
aggregated_metrics_weekly
}
it
'returns empty hash'
,
:aggregate_failures
do
expect
(
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
).
not_to
receive
(
aggregated_metrics_data_method
)
expect
(
aggregated_metrics_payload
).
to
be
{}
end
end
end
describe
'.aggregated_metrics_weekly'
do
subject
(
:aggregated_metrics_payload
)
{
described_class
.
aggregated_metrics_weekly
}
let
(
:aggregated_metrics_data_method
)
{
:aggregated_metrics_weekly_data
}
it_behaves_like
'aggregated_metrics_for_time_range'
it
'uses ::Gitlab::UsageDataCounters::HLLRedisCounter#aggregated_metrics_data'
,
:aggregate_failures
do
expect
(
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
).
to
receive
(
:aggregated_metrics_weekly_data
).
and_return
(
global_search_gmau:
123
)
expect
(
aggregated_metrics_payload
).
to
eq
(
aggregated_metrics:
{
global_search_gmau:
123
})
end
end
describe
'.aggregated_metrics_monthly'
do
subject
(
:aggregated_metrics_payload
)
{
described_class
.
aggregated_metrics_monthly
}
let
(
:aggregated_metrics_data_method
)
{
:aggregated_metrics_monthly_data
}
describe
'.aggregated_metrics_monthly'
do
subject
(
:aggregated_metrics_payload
)
{
described_class
.
aggregated_metrics_monthly
}
it_behaves_like
'aggregated_metrics_for_time_range'
it
'uses ::Gitlab::UsageDataCounters::HLLRedisCounter#aggregated_metrics_data'
,
:aggregate_failures
do
expect
(
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
).
to
receive
(
:aggregated_metrics_monthly_data
).
and_return
(
global_search_gmau:
123
)
expect
(
aggregated_metrics_payload
).
to
eq
(
aggregated_metrics:
{
global_search_gmau:
123
})
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