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
5db7e769
Commit
5db7e769
authored
Jun 20, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
0f06887a
ea795837
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
3 deletions
+34
-3
changelogs/unreleased/zj-gitaly-usage-data.yml
changelogs/unreleased/zj-gitaly-usage-data.yml
+5
-0
lib/gitaly/server.rb
lib/gitaly/server.rb
+16
-2
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+2
-1
spec/lib/gitaly/server_spec.rb
spec/lib/gitaly/server_spec.rb
+6
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+5
-0
No files found.
changelogs/unreleased/zj-gitaly-usage-data.yml
0 → 100644
View file @
5db7e769
---
title
:
Add Gitaly data to the usage ping
merge_request
:
author
:
type
:
added
lib/gitaly/server.rb
View file @
5db7e769
...
...
@@ -2,8 +2,18 @@
module
Gitaly
class
Server
def
self
.
all
Gitlab
.
config
.
repositories
.
storages
.
keys
.
map
{
|
s
|
Gitaly
::
Server
.
new
(
s
)
}
class
<<
self
def
all
Gitlab
.
config
.
repositories
.
storages
.
keys
.
map
{
|
s
|
Gitaly
::
Server
.
new
(
s
)
}
end
def
count
all
.
size
end
def
filesystems
all
.
map
(
&
:filesystem_type
).
compact
.
uniq
end
end
attr_reader
:storage
...
...
@@ -36,6 +46,10 @@ module Gitaly
storage_status
&
.
writeable
end
def
filesystem_type
storage_status
&
.
fs_type
end
def
address
Gitlab
::
GitalyClient
.
address
(
@storage
)
rescue
RuntimeError
=>
e
...
...
lib/gitlab/usage_data.rb
View file @
5db7e769
...
...
@@ -136,8 +136,9 @@ module Gitlab
def
components_usage_data
{
gitlab_pages:
{
enabled:
Gitlab
.
config
.
pages
.
enabled
,
version:
Gitlab
::
Pages
::
VERSION
},
git:
{
version:
Gitlab
::
Git
.
version
},
gitaly:
{
version:
Gitaly
::
Server
.
all
.
first
.
server_version
,
servers:
Gitaly
::
Server
.
count
,
filesystems:
Gitaly
::
Server
.
filesystems
},
gitlab_pages:
{
enabled:
Gitlab
.
config
.
pages
.
enabled
,
version:
Gitlab
::
Pages
::
VERSION
},
database:
{
adapter:
Gitlab
::
Database
.
adapter_name
,
version:
Gitlab
::
Database
.
version
}
}
end
...
...
spec/lib/gitaly/server_spec.rb
View file @
5db7e769
...
...
@@ -47,6 +47,12 @@ describe Gitaly::Server do
end
end
describe
"#filesystem_type"
do
subject
{
server
.
filesystem_type
}
it
{
is_expected
.
to
be_present
}
end
describe
'request memoization'
do
context
'when requesting multiple properties'
,
:request_store
do
it
'uses memoization for the info request'
do
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
5db7e769
...
...
@@ -54,6 +54,7 @@ describe Gitlab::UsageData do
gitlab_shared_runners_enabled
gitlab_pages
git
gitaly
database
avg_cycle_analytics
web_ide_commits
...
...
@@ -205,6 +206,10 @@ describe Gitlab::UsageData do
expect
(
subject
[
:git
][
:version
]).
to
eq
(
Gitlab
::
Git
.
version
)
expect
(
subject
[
:database
][
:adapter
]).
to
eq
(
Gitlab
::
Database
.
adapter_name
)
expect
(
subject
[
:database
][
:version
]).
to
eq
(
Gitlab
::
Database
.
version
)
expect
(
subject
[
:gitaly
][
:version
]).
to
be_present
expect
(
subject
[
:gitaly
][
:servers
]).
to
be
>=
1
expect
(
subject
[
:gitaly
][
:filesystems
]).
to
be_an
(
Array
)
expect
(
subject
[
:gitaly
][
:filesystems
].
first
).
to
be_a
(
String
)
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