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
6a549be4
Commit
6a549be4
authored
Feb 07, 2019
by
Victor Zagorodny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend UsageData with preferences usage
parent
00a3ccf5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+10
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+8
-1
No files found.
ee/lib/ee/gitlab/usage_data.rb
View file @
6a549be4
...
...
@@ -88,6 +88,16 @@ module EE
end
# rubocop: enable CodeReuse/ActiveRecord
# Note: when adding a preference, check if it's mapped to an attribute of a User model. If so, name
# the base key part after a corresponding User model attribute, use its possible values as suffix values.
override
:preferences_usage
def
preferences_usage
super
.
merge
(
preference_group_overview_details:
count
(
::
User
.
group_view_details
),
preference_group_overview_security_dashboard:
count
(
::
User
.
group_view_security_dashboard
)
)
end
override
:system_usage_data
def
system_usage_data
usage_data
=
super
...
...
lib/gitlab/usage_data.rb
View file @
6a549be4
...
...
@@ -92,7 +92,10 @@ module Gitlab
todos:
count
(
Todo
),
uploads:
count
(
Upload
),
web_hooks:
count
(
WebHook
)
}.
merge
(
services_usage
).
merge
(
approximate_counts
)
}
.
merge
(
services_usage
)
.
merge
(
approximate_counts
)
.
merge
(
preferences_usage
)
}
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
@@ -161,6 +164,10 @@ module Gitlab
}
end
def
preferences_usage
{}
end
def
count
(
relation
,
fallback:
-
1
)
relation
.
count
rescue
ActiveRecord
::
StatementInvalid
...
...
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