2016-12-30 19:19:59 +01:00
|
|
|
import * as os from 'os';
|
|
|
|
import Logger from './logger';
|
|
|
|
|
|
|
|
export default class MachineInfo {
|
2016-12-30 19:36:22 +01:00
|
|
|
static show(): void {
|
2016-12-30 19:19:59 +01:00
|
|
|
const totalmem = (os.totalmem() / 1024 / 1024 / 1024).toFixed(1);
|
|
|
|
const freemem = (os.freemem() / 1024 / 1024 / 1024).toFixed(1);
|
|
|
|
let logger = new Logger('Machine');
|
2017-01-02 20:35:32 +01:00
|
|
|
logger.info(`Hostname: ${os.hostname()}`);
|
|
|
|
logger.info(`Platform: ${process.platform}`);
|
|
|
|
logger.info(`Architecture: ${process.arch}`);
|
|
|
|
logger.info(`Node.js: ${process.version}`);
|
2016-12-30 19:19:59 +01:00
|
|
|
logger.info(`CPU: ${os.cpus().length}core`);
|
|
|
|
logger.info(`MEM: ${totalmem}GB (available: ${freemem}GB)`);
|
|
|
|
}
|
|
|
|
}
|