Last active
September 11, 2017 17:05
-
-
Save drush/8390853 to your computer and use it in GitHub Desktop.
Show a report of the current number of web and worker dynos and the stack used across all your Heroku apps.
This file contains 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
apps = `heroku apps`.split("\n\n")[0].lines[1..-1].collect{|l| l.strip } | |
printf("%-20s %4s %4s\n", 'APP', 'WEB', 'BG') | |
apps.each{|a| | |
astats = `heroku ps -a #{a}` | |
info = `heroku apps:info -a #{a}` | |
access = `heroku access -a #{a}` | |
stack = info.scan(/Stack:\s+(.*)/).first.last rescue 'NA' | |
web, workers = (astats.match(/web\.\d/).size rescue 0), (astats.match(/worker\.\d/).size rescue 0) | |
printf("%-20s %4s %4s %20s\t#{access}\n", a, web, workers, stack) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment