soyuka / pidusage

Cross-platform process cpu % and memory usage of a PID
MIT License
512 stars 55 forks source link

Add support for Android #85

Closed Vortex93 closed 5 years ago

Vortex93 commented 5 years ago

I currently have termux and pm2 installed on my Android.

Whenever I try to run an application using pm2, it returns the following:

$ pm2 logs
[TAILING] Tailing last 15 lines for [all] processes (change the value with --lines option)
/data/data/com.termux/files/home/.pm2/pm2.log last 15 lines:
PM2        | 2018-11-08T18:33:29: PM2 log: App [server:0] starting in -fork mode-
PM2        | 2018-11-08T18:33:29: PM2 log: App [server:0] online
PM2        | 2018-11-08T18:33:30: PM2 error: Error caught while calling pidusage
PM2        | 2018-11-08T18:33:30: PM2 error: Error: android is not supported yet, please open an issue (https://github.com/soyuka/pidusage)
PM2        | 2018-11-08T18:33:32: PM2 log: App [server:0] exited with code [1] via signal [SIGINT]
PM2        | 2018-11-08T18:33:33: PM2 log: App [server:0] starting in -fork mode-
PM2        | 2018-11-08T18:33:33: PM2 log: App [server:0] online
PM2        | 2018-11-08T18:33:33: PM2 error: Error caught while calling pidusage
PM2        | 2018-11-08T18:33:33: PM2 error: Error: android is not supported yet, please open an issue (https://github.com/soyuka/pidusage)
PM2        | 2018-11-08T18:33:35: PM2 log: App [server:0] exited with code [1] via signal [SIGINT]
PM2        | 2018-11-08T18:36:44: PM2 log: App [server:0] starting in -fork mode-
PM2        | 2018-11-08T18:36:44: PM2 log: App [server:0] online
PM2        | 2018-11-08T18:36:44: PM2 error: Error caught while calling pidusage
PM2        | 2018-11-08T18:36:44: PM2 error: Error: android is not supported yet, please open an issue (https://github.com/soyuka/pidusage)
PM2        | 2018-11-08T18:36:46: PM2 log: App [server:0] exited with code [1] via signal [SIGINT]

/data/data/com.termux/files/home/.pm2/logs/server-out-0.log last 15 lines:
/data/data/com.termux/files/home/.pm2/logs/server-error-0.log last 15 lines:
0|server| inspector.js:18
0|server|   throw new ERR_INSPECTOR_NOT_AVAILABLE();
0|server|   ^
0|server|
0|server| Error [ERR_INSPECTOR_NOT_AVAILABLE]: Inspector is not available
0|server|     at inspector.js:18:9
0|server|     at NativeModule.compile (internal/bootstrap/loaders.js:299:7)
0|server|     at Function.NativeModule.require (internal/bootstrap/loaders.js:168:18)
0|server|     at Function.Module._load (internal/modules/cjs/loader.js:523:25)
0|server|     at Module.require (internal/modules/cjs/loader.js:643:17)
0|server|     at require (internal/modules/cjs/helpers.js:22:18)
0|server|     at Object.<anonymous> (/data/data/com.termux/files/usr/lib/node_modules/pm2/node_modules/@pm2/io/build/main/src/services/inspector.js:3:19)
0|server|     at Module._compile (internal/modules/cjs/loader.js:707:30)
0|server|     at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
0|server|     at Module.load (internal/modules/cjs/loader.js:605:32)
soyuka commented 5 years ago

I must have missed this issue, fixed by #98 lmk if there are issues. Note that the error:

0|server| Error [ERR_INSPECTOR_NOT_AVAILABLE]: Inspector is not available

doesn't look related to this package.