Last active
December 10, 2015 17:38
-
-
Save nateware/4469142 to your computer and use it in GitHub Desktop.
Healthcheck in Sinatra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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