BigW Consortium Gitlab

redis_check.rb 579 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
module Gitlab
  module HealthChecks
    module Redis
      class RedisCheck
        extend SimpleAbstractCheck

        class << self
          private

          def metric_prefix
            'redis_ping'
          end

14
          def successful?(result)
15 16 17 18 19 20 21 22 23 24 25 26 27
            result == 'PONG'
          end

          def check
            ::Gitlab::HealthChecks::Redis::CacheCheck.check_up &&
              ::Gitlab::HealthChecks::Redis::QueuesCheck.check_up &&
              ::Gitlab::HealthChecks::Redis::SharedStateCheck.check_up
          end
        end
      end
    end
  end
end