diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-21 12:10:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-21 12:10:16 +0300 |
commit | 34ad6d995bcab9f88a236bfed15aebdad76df960 (patch) | |
tree | 4e47f30ed36fbdebd15933b10a04b80ae98f0475 /lib/gitlab/health_checks | |
parent | 1cf90c700837637f7989bda8fe81c616f19e8150 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/health_checks')
-rw-r--r-- | lib/gitlab/health_checks/unicorn_check.rb | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/lib/gitlab/health_checks/unicorn_check.rb b/lib/gitlab/health_checks/unicorn_check.rb deleted file mode 100644 index f0c6fdab600..00000000000 --- a/lib/gitlab/health_checks/unicorn_check.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module HealthChecks - # This check can only be run on Unicorn `master` process - class UnicornCheck - extend SimpleAbstractCheck - - class << self - include Gitlab::Utils::StrongMemoize - - private - - def metric_prefix - 'unicorn_check' - end - - def successful?(result) - result > 0 - end - - def check - return unless http_servers - - http_servers.sum(&:worker_processes) - end - - # Traversal of ObjectSpace is expensive, on fully loaded application - # it takes around 80ms. The instances of HttpServers are not a subject - # to change so we can cache the list of servers. - def http_servers - strong_memoize(:http_servers) do - next unless Gitlab::Runtime.unicorn? - - ObjectSpace.each_object(::Unicorn::HttpServer).to_a - end - end - end - end - end -end |