Не подтверждена Коммит 44528f6c создал по автору Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg
Просмотр файлов

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
владелец 4298a28a
---
title: Add Gitaly data to the usage ping
merge_request:
author:
type: added
......@@ -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 @@ def writeable?
storage_status&.writeable
end
def filesystem_type
storage_status&.fs_type
end
def address
Gitlab::GitalyClient.address(@storage)
rescue RuntimeError => e
......
......@@ -136,8 +136,9 @@ def usage_counters
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
......
......@@ -47,6 +47,12 @@
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
......
......@@ -54,6 +54,7 @@
gitlab_shared_runners_enabled
gitlab_pages
git
gitaly
database
avg_cycle_analytics
web_ide_commits
......@@ -205,6 +206,10 @@
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
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать