Commit 37f27079 authored by Pawel Chojnacki's avatar Pawel Chojnacki

Fix redis check with_timing method usage

parent b1d6670d
...@@ -15,14 +15,13 @@ module Gitlab ...@@ -15,14 +15,13 @@ module Gitlab
end end
def metrics def metrics
with_timing method(:check) do |result, elapsed| 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 is_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", is_successful?(result) ? 1 : 0),
metric("#{metric_prefix}_latency_seconds", elapsed) metric("#{metric_prefix}_latency_seconds", elapsed)
] ]
end
end end
private private
......
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