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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-08 00:13:35 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-08 00:13:35 +0300
commitc12e8312f6021bc8b2d9aa796fde9abc428b6a74 (patch)
tree055709b8bc11521326bc349d0e3c9872fc6d75cf /lib/gitlab/health_checks
parent49018dacf018e4ec9536d0a37619cee286918f10 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/health_checks')
-rw-r--r--lib/gitlab/health_checks/redis.rb16
-rw-r--r--lib/gitlab/health_checks/redis/cache_check.rb11
-rw-r--r--lib/gitlab/health_checks/redis/queues_check.rb11
-rw-r--r--lib/gitlab/health_checks/redis/rate_limiting_check.rb11
-rw-r--r--lib/gitlab/health_checks/redis/redis_abstract_check.rb4
-rw-r--r--lib/gitlab/health_checks/redis/redis_check.rb38
-rw-r--r--lib/gitlab/health_checks/redis/sessions_check.rb11
-rw-r--r--lib/gitlab/health_checks/redis/shared_state_check.rb11
-rw-r--r--lib/gitlab/health_checks/redis/trace_chunks_check.rb11
9 files changed, 18 insertions, 106 deletions
diff --git a/lib/gitlab/health_checks/redis.rb b/lib/gitlab/health_checks/redis.rb
new file mode 100644
index 00000000000..895bce5a5a9
--- /dev/null
+++ b/lib/gitlab/health_checks/redis.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module HealthChecks
+ module Redis
+ ALL_INSTANCE_CHECKS =
+ ::Gitlab::Redis::ALL_CLASSES.map do |instance_class|
+ check_class = Class.new
+ check_class.extend(RedisAbstractCheck)
+ const_set("#{instance_class.store_name}Check", check_class)
+
+ check_class
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/health_checks/redis/cache_check.rb b/lib/gitlab/health_checks/redis/cache_check.rb
deleted file mode 100644
index bd843bdaac4..00000000000
--- a/lib/gitlab/health_checks/redis/cache_check.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module HealthChecks
- module Redis
- class CacheCheck
- extend RedisAbstractCheck
- end
- end
- end
-end
diff --git a/lib/gitlab/health_checks/redis/queues_check.rb b/lib/gitlab/health_checks/redis/queues_check.rb
deleted file mode 100644
index fb92db937dc..00000000000
--- a/lib/gitlab/health_checks/redis/queues_check.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module HealthChecks
- module Redis
- class QueuesCheck
- extend RedisAbstractCheck
- end
- end
- end
-end
diff --git a/lib/gitlab/health_checks/redis/rate_limiting_check.rb b/lib/gitlab/health_checks/redis/rate_limiting_check.rb
deleted file mode 100644
index 0e9d94f7dff..00000000000
--- a/lib/gitlab/health_checks/redis/rate_limiting_check.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module HealthChecks
- module Redis
- class RateLimitingCheck
- extend RedisAbstractCheck
- end
- end
- end
-end
diff --git a/lib/gitlab/health_checks/redis/redis_abstract_check.rb b/lib/gitlab/health_checks/redis/redis_abstract_check.rb
index ecad4b06ea9..9a9a4d1faba 100644
--- a/lib/gitlab/health_checks/redis/redis_abstract_check.rb
+++ b/lib/gitlab/health_checks/redis/redis_abstract_check.rb
@@ -10,12 +10,12 @@ module Gitlab
successful?(check)
end
- private
-
def redis_instance_class_name
Gitlab::Redis.const_get(redis_instance_name.camelize, false)
end
+ private
+
def metric_prefix
"redis_#{redis_instance_name}_ping"
end
diff --git a/lib/gitlab/health_checks/redis/redis_check.rb b/lib/gitlab/health_checks/redis/redis_check.rb
deleted file mode 100644
index c793a939abd..00000000000
--- a/lib/gitlab/health_checks/redis/redis_check.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module HealthChecks
- module Redis
- class RedisCheck
- extend SimpleAbstractCheck
-
- class << self
- private
-
- def metric_prefix
- 'redis_ping'
- end
-
- def successful?(result)
- result == true
- end
-
- def check
- redis_health_checks.all?(&:check_up)
- end
-
- def redis_health_checks
- [
- Gitlab::HealthChecks::Redis::CacheCheck,
- Gitlab::HealthChecks::Redis::QueuesCheck,
- Gitlab::HealthChecks::Redis::SharedStateCheck,
- Gitlab::HealthChecks::Redis::TraceChunksCheck,
- Gitlab::HealthChecks::Redis::RateLimitingCheck,
- Gitlab::HealthChecks::Redis::SessionsCheck
- ]
- end
- end
- end
- end
- end
-end
diff --git a/lib/gitlab/health_checks/redis/sessions_check.rb b/lib/gitlab/health_checks/redis/sessions_check.rb
deleted file mode 100644
index 90a4c868f40..00000000000
--- a/lib/gitlab/health_checks/redis/sessions_check.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module HealthChecks
- module Redis
- class SessionsCheck
- extend RedisAbstractCheck
- end
- end
- end
-end
diff --git a/lib/gitlab/health_checks/redis/shared_state_check.rb b/lib/gitlab/health_checks/redis/shared_state_check.rb
deleted file mode 100644
index 80f91784b8c..00000000000
--- a/lib/gitlab/health_checks/redis/shared_state_check.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module HealthChecks
- module Redis
- class SharedStateCheck
- extend RedisAbstractCheck
- end
- end
- end
-end
diff --git a/lib/gitlab/health_checks/redis/trace_chunks_check.rb b/lib/gitlab/health_checks/redis/trace_chunks_check.rb
deleted file mode 100644
index 9a89a1ce51d..00000000000
--- a/lib/gitlab/health_checks/redis/trace_chunks_check.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module HealthChecks
- module Redis
- class TraceChunksCheck
- extend RedisAbstractCheck
- end
- end
- end
-end