有没有办法找出一个node.js进程的%cpu用法与代码?这样当node.js服务器正在运行并且检测到CPU已经超过了某个%时,那么它将会发出警报或控制台的输出。
尝试看这个代码: https://github.com/last/healthjs
Network service for getting CPU of remote system and receiving CPU usage alerts…
Health.js serves 2 primary modes: “streaming mode” and “event mode”. Streaming mode allows a client to connect and receive streaming CPU usage data. Event mode enables Health.js to notify a remote server when CPU usage hits a certain threshold. Both modes can be run simultaneously…