2019-02-04 15:49:00 -06:00
|
|
|
import * as os from 'os';
|
|
|
|
import * as sysUtils from 'systeminformation';
|
2021-08-19 07:55:45 -05:00
|
|
|
import Logger from '@/services/logger';
|
2019-02-04 15:49:00 -06:00
|
|
|
|
|
|
|
export async function showMachineInfo(parentLogger: Logger) {
|
|
|
|
const logger = parentLogger.createSubLogger('machine');
|
|
|
|
logger.debug(`Hostname: ${os.hostname()}`);
|
2019-02-20 07:05:34 -06:00
|
|
|
logger.debug(`Platform: ${process.platform} Arch: ${process.arch}`);
|
2019-02-04 15:49:00 -06:00
|
|
|
const mem = await sysUtils.mem();
|
|
|
|
const totalmem = (mem.total / 1024 / 1024 / 1024).toFixed(1);
|
|
|
|
const availmem = (mem.available / 1024 / 1024 / 1024).toFixed(1);
|
2019-02-20 07:05:34 -06:00
|
|
|
logger.debug(`CPU: ${os.cpus().length} core MEM: ${totalmem}GB (available: ${availmem}GB)`);
|
2019-02-04 15:49:00 -06:00
|
|
|
}
|