Get/View Memory & CPU usage via NodeJS

后端 未结 4 1710
猫巷女王i
猫巷女王i 2020-12-13 03:34

I see there are several node packages that allow you to look up a specific process\'s usage, such as https://www.npmjs.com/package/usage

I am trying to get the overa

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 04:39

    You can also use process.cpuUsage() to return the system and user cpu time in microseconds. It can also calculate the difference to a previous call.

    https://nodejs.org/api/process.html#process_process_cpuusage_previousvalue

提交回复
热议问题