mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-30 12:43:59 -06:00
21 lines
570 B
JavaScript
21 lines
570 B
JavaScript
'use strict';
|
|
|
|
const log = require('./log.js');
|
|
const logLevels = require('./enums/logLevels.js');
|
|
|
|
// once a minute
|
|
setInterval(gatherMemory, 1000 * 60);
|
|
|
|
/**
|
|
* Gathers system memory and logs it to the remote system
|
|
*/
|
|
function gatherMemory() {
|
|
let memory = process.getProcessMemoryInfo();
|
|
let details =
|
|
'workingSetSize: ' + memory.workingSetSize +
|
|
' peakWorkingSetSize: ' + memory.peakWorkingSetSize +
|
|
' privatesBytes: ' + memory.privatesBytes +
|
|
' sharedBytes: ' + memory.sharedBytes;
|
|
log.send(logLevels.INFO, details);
|
|
}
|