Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-06-20 21:39:28 +0300
committerStan Hu <stanhu@gmail.com>2019-06-20 21:39:28 +0300
commitea795837fdaf23c4da423e0c71268e31687d7849 (patch)
tree1738542e94cdc740fb766e9302cf8be37ffe2788 /lib
parent2b58712527ee8f47c1c1818511e4f0516c933fa4 (diff)
parent44528f6c444ae55008866d2861f1d160486b37d1 (diff)
Merge branch 'zj-gitaly-usage-data' into 'master'
Add Gitaly data to the usage ping See merge request gitlab-org/gitlab-ce!29893
Diffstat (limited to 'lib')
-rw-r--r--lib/gitaly/server.rb18
-rw-r--r--lib/gitlab/usage_data.rb3
2 files changed, 18 insertions, 3 deletions
diff --git a/lib/gitaly/server.rb b/lib/gitaly/server.rb
index 7b238623418..907c6e1b605 100644
--- a/lib/gitaly/server.rb
+++ b/lib/gitaly/server.rb
@@ -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
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index 9aa2e972adf..0180fe7fa71 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -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