NodeJS allows you to set process.title to an arbitrary string. Doing so sets $0, argv[0], to the title value. The value will show up in ps or top listings instead of "node ./index.js" - even in the docker container version.
This is a trivial request - just set process.title = "smartthings-mqtt-bridge" at the top of server.js.
On a system with a number of microservices running in docker containers, top/ps would show node./index.js for each of them, so you can't look at the top output and see WHICH container is abusing the CPU or RAM...
The process.title property returns the current process title (i.e. returns the current value of ps). Assigning a new value to process.title modifies the current value of ps.
When a new value is assigned, different platforms will impose different maximum length restrictions on the title. Usually such restrictions are quite limited. For instance, on Linux and macOS, process.title is limited to the size of the binary name plus the length of the command line arguments because setting the process.title overwrites the argv memory of the process. Node.js v0.8 allowed for longer process title strings by also overwriting the environ memory but that was potentially insecure and confusing in some (rather obscure) cases.
NodeJS allows you to set process.title to an arbitrary string. Doing so sets $0, argv[0], to the title value. The value will show up in ps or top listings instead of "node ./index.js" - even in the docker container version.
This is a trivial request - just set process.title = "smartthings-mqtt-bridge" at the top of server.js.
On a system with a number of microservices running in docker containers, top/ps would show node./index.js for each of them, so you can't look at the top output and see WHICH container is abusing the CPU or RAM...
Ideally, the code would look like:
Thanks for this server/repo. It is awesome.