Class: Epsilla::Health

Inherits:
Base
  • Object
show all
Defined in:
lib/epsilla/health.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Epsilla::Base

Instance Method Details

#live?Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
12
13
14
15
# File 'lib/epsilla/health.rb', line 6

def live?
  response = client.connection.get do |req|
    req.url '/'
  end
  if response.status != 200
    raise Exception.new "[ERROR] Failed to connect to #{@url}"
  else
    true
  end
end

#stateObject



17
18
19
20
# File 'lib/epsilla/health.rb', line 17

def state
  response = client.connection.get("/state")
  response.status == 200
end