Reputation: 6055
I'd quite like to know whether there's a simple way of knowing the list of running processes in your app, from inside a running process.
For instance, let's say I have a web
process and a worker
process. From within the web
process, can I know that I have 2 worker
processes running?
Upvotes: 0
Views: 373
Reputation: 1767
yes you can that by adding heroku Gem in your Gemfile.
and then running system commands from code. I have tried this on heroku bash
Running bash attached to terminal... up, run.1 ~ $ heroku ~ $ ~ $ heroku -v 2.25.0 ~ $ heroku ps
Process State Command
web ....
It will prompt for password so you can your heroku client class for login purpose and then listing all processes.
Hope this will help you.
Upvotes: 1