sharkey/src/utils/machineInfo.ts

17 lines
587 B
TypeScript
Raw Normal View History

2016-12-31 03:19:59 +09:00
import * as os from 'os';
import Logger from './logger';
2017-01-03 04:39:44 +09:00
export default class {
2017-05-24 20:50:17 +09:00
public static show(): void {
2016-12-31 03:19:59 +09:00
const totalmem = (os.totalmem() / 1024 / 1024 / 1024).toFixed(1);
const freemem = (os.freemem() / 1024 / 1024 / 1024).toFixed(1);
2017-05-24 20:50:17 +09:00
const logger = new Logger('Machine');
2017-01-03 04:35:32 +09:00
logger.info(`Hostname: ${os.hostname()}`);
logger.info(`Platform: ${process.platform}`);
logger.info(`Architecture: ${process.arch}`);
logger.info(`Node.js: ${process.version}`);
2016-12-31 03:19:59 +09:00
logger.info(`CPU: ${os.cpus().length}core`);
logger.info(`MEM: ${totalmem}GB (available: ${freemem}GB)`);
}
}