Skip to content

Instantly share code, notes, and snippets.

@nateware
Last active December 10, 2015 17:38
Show Gist options
  • Save nateware/4469142 to your computer and use it in GitHub Desktop.
Save nateware/4469142 to your computer and use it in GitHub Desktop.
Healthcheck in Sinatra
# Ruby/Sinatra ELB health check example - GET /healthchk
get '/health' do
# any DB connection errors below will throw exceptions
Timeout.timeout(5) do
nkeys = Redis.current.dbsize
status = DB.fetch("show engine innodb status").first[:Status]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment