java - Can you programmatically access current Heroku dyno id/name? -


on heroku, can programmatically, within app, kind of identifier dyno executing code? example dyno name (e.g. "web.1" or "worker.1"), or other id.

if yes, how in java?

there hostname of machine (which looks d.long_guid. suppose (though haven't tried) should work:

string localhostname = java.net.inetaddress.getlocalhost().gethostname();

also, little known secret, can "web.1", "web.2" id's looking @ value of environment variable ps1

string hostid = system.getenv("ps1")

edit 2013-july-26

as per heroku changelog, local environment variable dyno replaces ps, replaced ps1.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -