Reputation: 938
I am writing a small NodeJS service that I want to be able to monitor a process given the PID of that process. I want to be able to gather the following info about the process:
All processes that I will be monitoring will have been started using the child_process exec (or spawn) function, so I can get the PID from there. Technically, I could record the start time when the process is spawned, but I think this wouldn't be all that accurate?
What would be the best way to get all the above information? It would be good to get and end time when the process exited as well.
Upvotes: 4
Views: 3596