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

replace `is_successful?` with `successful?`

parent 78c5d4dd
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
'db_ping' 'db_ping'
end end
def is_successful?(result) def successful?(result)
result == '1' result == '1'
end end
......
...@@ -15,7 +15,7 @@ module Gitlab ...@@ -15,7 +15,7 @@ module Gitlab
'redis_cache_ping' 'redis_cache_ping'
end end
def is_successful?(result) def successful?(result)
result == 'PONG' result == 'PONG'
end end
......
...@@ -15,7 +15,7 @@ module Gitlab ...@@ -15,7 +15,7 @@ module Gitlab
'redis_queues_ping' 'redis_queues_ping'
end end
def is_successful?(result) def successful?(result)
result == 'PONG' result == 'PONG'
end end
......
...@@ -11,7 +11,7 @@ module Gitlab ...@@ -11,7 +11,7 @@ module Gitlab
'redis_ping' 'redis_ping'
end end
def is_successful?(result) def successful?(result)
result == 'PONG' result == 'PONG'
end end
......
...@@ -15,7 +15,7 @@ module Gitlab ...@@ -15,7 +15,7 @@ module Gitlab
'redis_shared_state_ping' 'redis_shared_state_ping'
end end
def is_successful?(result) def successful?(result)
result == 'PONG' result == 'PONG'
end end
......
...@@ -5,7 +5,7 @@ module Gitlab ...@@ -5,7 +5,7 @@ module Gitlab
def readiness def readiness
check_result = check check_result = check
if is_successful?(check_result) if successful?(check_result)
HealthChecks::Result.new(true) HealthChecks::Result.new(true)
elsif check_result.is_a?(Timeout::Error) elsif check_result.is_a?(Timeout::Error)
HealthChecks::Result.new(false, "#{human_name} check timed out") HealthChecks::Result.new(false, "#{human_name} check timed out")
...@@ -16,10 +16,10 @@ module Gitlab ...@@ -16,10 +16,10 @@ module Gitlab
def metrics def metrics
result, elapsed = with_timing(&method(:check)) 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}_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) metric("#{metric_prefix}_latency_seconds", elapsed)
] ]
end end
...@@ -30,7 +30,7 @@ module Gitlab ...@@ -30,7 +30,7 @@ module Gitlab
raise NotImplementedError raise NotImplementedError
end end
def is_successful?(result) def successful?(result)
raise NotImplementedError raise NotImplementedError
end 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