Class: Heartcheck::Checks::Redis

Inherits:
Base
  • Object
show all
Defined in:
lib/heartcheck/checks/redis.rb

Overview

Check for a redis service Base is set in heartcheck gem

Instance Method Summary collapse

Instance Method Details

#uri_infoArray

list services uri info

Returns:

  • (Array)


22
23
24
25
26
27
28
29
30
31
# File 'lib/heartcheck/checks/redis.rb', line 22

def uri_info
  services.map do |s|
    opts = s[:connection].connection
    {
      host: opts[:host],
      port: opts[:port],
      scheme: 'redis'.freeze
    }
  end
end

#validateObject

validate each service



9
10
11
12
13
14
15
16
17
# File 'lib/heartcheck/checks/redis.rb', line 9

def validate
  services.each do |service|
    connection = service[:connection]

    append_error(service[:name], :set) unless set?(connection)
    append_error(service[:name], :get) unless get?(connection)
    append_error(service[:name], :delete) unless del?(connection)
  end
end