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
e63a8230
Commit
e63a8230
authored
Oct 07, 2020
by
Alishan Ladhani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix regression in snowplow_event_counts
parent
c9a519bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+1
-1
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+10
-0
No files found.
lib/gitlab/usage_data.rb
View file @
e63a8230
...
...
@@ -201,7 +201,7 @@ module Gitlab
personal_snippets:
count
(
PersonalSnippet
.
where
(
last_28_days_time_period
)),
project_snippets:
count
(
ProjectSnippet
.
where
(
last_28_days_time_period
))
}.
merge
(
snowplow_event_counts
(
time_period:
last_28_days_time_period
(
column: :collector_tstamp
))
snowplow_event_counts
(
last_28_days_time_period
(
column: :collector_tstamp
))
).
tap
do
|
data
|
data
[
:snippets
]
=
data
[
:personal_snippets
]
+
data
[
:project_snippets
]
end
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
e63a8230
...
...
@@ -587,8 +587,17 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
describe
'.system_usage_data_monthly'
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let!
(
:ud
)
{
build
(
:usage_data
)
}
before
do
stub_application_setting
(
self_monitoring_project:
project
)
for_defined_days_back
do
create
(
:product_analytics_event
,
project:
project
,
se_category:
'epics'
,
se_action:
'promote'
)
end
end
subject
{
described_class
.
system_usage_data_monthly
}
it
'gathers monthly usage counts correctly'
do
...
...
@@ -601,6 +610,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect
(
counts_monthly
[
:personal_snippets
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:project_snippets
]).
to
eq
(
2
)
expect
(
counts_monthly
[
:packages
]).
to
eq
(
3
)
expect
(
counts_monthly
[
:promoted_issues
]).
to
eq
(
1
)
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