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
0d15c12f
Commit
0d15c12f
authored
Aug 25, 2020
by
Giorgenes Gelatti
Committed by
Toon Claes
Sep 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds rolling package count to usage data
parent
68c0a78a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
1 deletion
+9
-1
changelogs/unreleased/205578-add-package-count-to-usage-data-28days.yml
...eleased/205578-add-package-count-to-usage-data-28days.yml
+5
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+1
-0
spec/factories/usage_data.rb
spec/factories/usage_data.rb
+1
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+2
-1
No files found.
changelogs/unreleased/205578-add-package-count-to-usage-data-28days.yml
0 → 100644
View file @
0d15c12f
---
title
:
Adds monthly package data to usage ping
merge_request
:
40452
author
:
type
:
added
lib/gitlab/usage_data.rb
View file @
0d15c12f
...
@@ -181,6 +181,7 @@ module Gitlab
...
@@ -181,6 +181,7 @@ module Gitlab
successful_deployments:
deployment_count
(
Deployment
.
success
.
where
(
last_28_days_time_period
)),
successful_deployments:
deployment_count
(
Deployment
.
success
.
where
(
last_28_days_time_period
)),
failed_deployments:
deployment_count
(
Deployment
.
failed
.
where
(
last_28_days_time_period
)),
failed_deployments:
deployment_count
(
Deployment
.
failed
.
where
(
last_28_days_time_period
)),
# rubocop: enable UsageData/LargeTable:
# rubocop: enable UsageData/LargeTable:
packages:
count
(
::
Packages
::
Package
.
where
(
last_28_days_time_period
)),
personal_snippets:
count
(
PersonalSnippet
.
where
(
last_28_days_time_period
)),
personal_snippets:
count
(
PersonalSnippet
.
where
(
last_28_days_time_period
)),
project_snippets:
count
(
ProjectSnippet
.
where
(
last_28_days_time_period
))
project_snippets:
count
(
ProjectSnippet
.
where
(
last_28_days_time_period
))
}.
tap
do
|
data
|
}.
tap
do
|
data
|
...
...
spec/factories/usage_data.rb
View file @
0d15c12f
...
@@ -101,6 +101,7 @@ FactoryBot.define do
...
@@ -101,6 +101,7 @@ FactoryBot.define do
create
(
:package
,
project:
projects
[
0
])
create
(
:package
,
project:
projects
[
0
])
create
(
:package
,
project:
projects
[
0
])
create
(
:package
,
project:
projects
[
0
])
create
(
:package
,
project:
projects
[
1
])
create
(
:package
,
project:
projects
[
1
])
create
(
:package
,
created_at:
2
.
months
.
ago
,
project:
projects
[
1
])
ProjectFeature
.
first
.
update_attribute
(
'repository_access_level'
,
0
)
ProjectFeature
.
first
.
update_attribute
(
'repository_access_level'
,
0
)
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
0d15c12f
...
@@ -479,7 +479,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
...
@@ -479,7 +479,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect
(
count_data
[
:project_snippets
]).
to
eq
(
4
)
expect
(
count_data
[
:project_snippets
]).
to
eq
(
4
)
expect
(
count_data
[
:projects_with_packages
]).
to
eq
(
2
)
expect
(
count_data
[
:projects_with_packages
]).
to
eq
(
2
)
expect
(
count_data
[
:packages
]).
to
eq
(
3
)
expect
(
count_data
[
:packages
]).
to
eq
(
4
)
end
end
it
'gathers object store usage correctly'
do
it
'gathers object store usage correctly'
do
...
@@ -572,6 +572,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
...
@@ -572,6 +572,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect
(
counts_monthly
[
:snippets
]).
to
eq
(
3
)
expect
(
counts_monthly
[
:snippets
]).
to
eq
(
3
)
expect
(
counts_monthly
[
:personal_snippets
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:personal_snippets
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:project_snippets
]).
to
eq
(
2
)
expect
(
counts_monthly
[
:project_snippets
]).
to
eq
(
2
)
expect
(
counts_monthly
[
:packages
]).
to
eq
(
3
)
end
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