Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

gem that allows easy querying of your heroku app's queue depth

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 heroscale.gemspec
README.md

Heroscale

This gem provides a Rack Interface to your Heroku web app that allows you to query the current HTTP_X_HEROKU_QUEUE_DEPTH for your app via an api handler

This allows you to query your app to get the queue size and current dyno count /heroscale/status

Installation (Rails 3)

To install Heroscale, just add the following line to your Gemfile:

gem "heroscale"

Then run bundle install

Deploy to Heroku and test that it works

After adding the gem and configuraton, go ahead and deploy to heroku

git push heroku master

Once you've deployed and everything seems to be working, go ahead and test it out by running

rake heroscale:test

This will query your heroku app and verify that it is returning the right response.

Securing

For most people, having the queue size and dynos on a publically available url is not a big deal. However if you want to secure it, just run:

rails g heroscale:secure

This will generate an config within config/initializers/heroscale.rb with a generated api key

Heroscale.configure do |c|
  c.api_key = "my_api_key"
end

Queries to your app will then need to be: /heroscale/status?api=my_api_key

Redeploy to Heroku and then run:

rake heroscale:test

to verify everything is still working

Installation (Sinatra)

Just add Heroscale::Middleware to your config.ru

TODO: more details

Installation (Rails 2)

TODO: more details

Something went wrong with that request. Please try again.