summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2019-06-20 13:04:56 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2019-06-20 15:26:56 +0200
commit44528f6c444ae55008866d2861f1d160486b37d1 (patch)
tree014053b528e80d078096dc620fcbbb012ef522d9 /lib
parent4298a28a993363f4ab6b63c14820492393a3ae94 (diff)
downloadgitlab-ce-44528f6c444ae55008866d2861f1d160486b37d1.tar.gz
Add Gitaly data to the usage ping
Gitaly data wasn't available to the team, an this change is a first iteration towards understanding what data we need and how to interpret it. Later more values will be added. For now the most important thing is the filesystem String Array, as that includes data on ext4 exposure and NFS. Part of: https://gitlab.com/gitlab-org/gitlab-ce/issues/60602
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