Commit 622c912d authored by Maxim Rydkin's avatar Maxim Rydkin

replace `is_successful?` with `successful?`

parent 78c5d4dd
......@@ -10,7 +10,7 @@ module Gitlab
'db_ping'
end
def is_successful?(result)
def successful?(result)
result == '1'
end
......
......@@ -15,7 +15,7 @@ module Gitlab
'redis_cache_ping'
end
def is_successful?(result)
def successful?(result)
result == 'PONG'
end
......
......@@ -15,7 +15,7 @@ module Gitlab
'redis_queues_ping'
end
def is_successful?(result)
def successful?(result)
result == 'PONG'
end
......
......@@ -11,7 +11,7 @@ module Gitlab
'redis_ping'
end
def is_successful?(result)
def successful?(result)
result == 'PONG'
end
......
......@@ -15,7 +15,7 @@ module Gitlab
'redis_shared_state_ping'
end
def is_successful?(result)
def successful?(result)
result == 'PONG'
end
......
......@@ -5,7 +5,7 @@ module Gitlab
def readiness
check_result = check
if is_successful?(check_result)
if successful?(check_result)
HealthChecks::Result.new(true)
elsif check_result.is_a?(Timeout::Error)
HealthChecks::Result.new(false, "#{human_name} check timed out")
......@@ -16,10 +16,10 @@ module Gitlab
def metrics
result, elapsed = with_timing(&method(:check))
Rails.logger.error("#{human_name} check returned unexpected result #{result}") unless is_successful?(result)
Rails.logger.error("#{human_name} check returned unexpected result #{result}") unless successful?(result)
[
metric("#{metric_prefix}_timeout", result.is_a?(Timeout::Error) ? 1 : 0),
metric("#{metric_prefix}_success", is_successful?(result) ? 1 : 0),
metric("#{metric_prefix}_success", successful?(result) ? 1 : 0),
metric("#{metric_prefix}_latency_seconds", elapsed)
]
end
......@@ -30,7 +30,7 @@ module Gitlab
raise NotImplementedError
end
def is_successful?(result)
def successful?(result)
raise NotImplementedError
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment