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
0bc907db
Commit
0bc907db
authored
Sep 29, 2020
by
Alishan Ladhani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove total counts for snowplow events
parent
68e9a78a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+2
-3
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+9
-7
No files found.
lib/gitlab/usage_data.rb
View file @
0bc907db
...
...
@@ -167,8 +167,7 @@ module Gitlab
user_preferences_usage
,
ingress_modsecurity_usage
,
container_expiration_policies_usage
,
service_desk_counts
,
snowplow_event_counts
service_desk_counts
).
tap
do
|
data
|
data
[
:snippets
]
=
data
[
:personal_snippets
]
+
data
[
:project_snippets
]
end
...
...
@@ -176,7 +175,7 @@ module Gitlab
end
# rubocop: enable Metrics/AbcSize
def
snowplow_event_counts
(
time_period
:
{}
)
def
snowplow_event_counts
(
time_period
)
return
{}
unless
report_snowplow_events?
{
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
0bc907db
...
...
@@ -1213,6 +1213,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
describe
'.snowplow_event_counts'
do
let_it_be
(
:time_period
)
{
{
collector_tstamp:
8
.
days
.
ago
..
1
.
day
.
ago
}
}
context
'when self-monitoring project exists'
do
let_it_be
(
:project
)
{
create
(
:project
)
}
...
...
@@ -1225,14 +1227,14 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
stub_feature_flags
(
product_analytics:
project
)
create
(
:product_analytics_event
,
project:
project
,
se_category:
'epics'
,
se_action:
'promote'
)
create
(
:product_analytics_event
,
project:
project
,
se_category:
'epics'
,
se_action:
'promote'
,
collector_tstamp:
28
.
days
.
ago
)
create
(
:product_analytics_event
,
project:
project
,
se_category:
'epics'
,
se_action:
'promote'
,
collector_tstamp:
2
.
days
.
ago
)
create
(
:product_analytics_event
,
project:
project
,
se_category:
'epics'
,
se_action:
'promote'
,
collector_tstamp:
9
.
days
.
ago
)
create
(
:product_analytics_event
,
project:
project
,
se_category:
'foo'
,
se_action:
'bar'
,
collector_tstamp:
2
.
days
.
ago
)
end
it
'returns promoted_issues for the time period'
do
expect
(
described_class
.
snowplow_event_counts
[
:promoted_issues
]).
to
eq
(
2
)
expect
(
described_class
.
snowplow_event_counts
(
time_period:
described_class
.
last_28_days_time_period
(
column: :collector_tstamp
)
)[
:promoted_issues
]).
to
eq
(
1
)
expect
(
described_class
.
snowplow_event_counts
(
time_period
)[
:promoted_issues
]).
to
eq
(
1
)
end
end
...
...
@@ -1242,14 +1244,14 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
it
'returns an empty hash'
do
expect
(
described_class
.
snowplow_event_counts
).
to
eq
({})
expect
(
described_class
.
snowplow_event_counts
(
time_period
)
).
to
eq
({})
end
end
end
context
'when self-monitoring project does not exist'
do
it
'returns an empty hash'
do
expect
(
described_class
.
snowplow_event_counts
).
to
eq
({})
expect
(
described_class
.
snowplow_event_counts
(
time_period
)
).
to
eq
({})
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