pm2-perfmonitor 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/app.js +3 -1
  2. package/package.json +1 -1
package/lib/app.js CHANGED
@@ -198,9 +198,11 @@ const processChecker = async () => {
198
198
  const { name, pid, pm_id, monit, pm2_env } = app
199
199
 
200
200
  const sysCpuUsage = await getSysCpuUsageByPid(pid)
201
+ const pm2CpuUsage = monit?.cpu
201
202
 
202
203
  const appStatus = pm2_env?.status
203
- const appCpuUsage = sysCpuUsage
204
+ const appCpuUsage =
205
+ typeof sysCpuUsage === 'number' ? sysCpuUsage : pm2CpuUsage
204
206
 
205
207
  // 非目标应用,跳过
206
208
  if (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pm2-perfmonitor",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "A pm2 module for performance monitoring. Automatically detect zombie processes and restart it",
5
5
  "author": {
6
6
  "name": "elenh",