Add Factorio CPU and Memory usage statistics

Add per instance metrics for CPU and memory usage with the pidusage
library.
This commit is contained in:
Hornwitser committed 2020-04-09 16:17:38 +02:00
1 parent 56ee1fe955
commit 6bc07ad1b3
4 files changed
+35

No files matched your search

+10
View File
@@ -590,6 +590,16 @@ class FactorioServer extends events.EventEmitter {
return this._version;
}
/**
* The pid of the server process, or null if not running
*/
get pid() {
if (!this._server) {
return null;
}
return this._server.pid;
}
_attachStdio() {
this._server.stdout.on('data', chunk => { this._stdout.data(chunk); });
this._server.stdout.on('close', () => { this._stdout.end(); });