This commit is contained in:
Aya Morisawa 2018-11-06 03:31:16 +09:00 committed by syuilo
parent 34e249317a
commit 6c5a78aeb2
2 changed files with 7 additions and 5 deletions

View file

@ -114,7 +114,7 @@ async function init(): Promise<Config> {
Logger.info(`<<< Misskey v${pkg.version} >>>`); Logger.info(`<<< Misskey v${pkg.version} >>>`);
new Logger('Deps').info(`Node.js ${process.version}`); new Logger('Deps').info(`Node.js ${process.version}`);
MachineInfo.show(); await MachineInfo.show();
EnvironmentInfo.show(); EnvironmentInfo.show();
const configLogger = new Logger('Config'); const configLogger = new Logger('Config');

View file

@ -1,15 +1,17 @@
import * as os from 'os'; import * as os from 'os';
import Logger from './logger'; import Logger from './logger';
import * as sysUtils from 'systeminformation';
export default class { export default class {
public static show(): void { public static async show() {
const totalmem = (os.totalmem() / 1024 / 1024 / 1024).toFixed(1);
const freemem = (os.freemem() / 1024 / 1024 / 1024).toFixed(1);
const logger = new Logger('Machine'); const logger = new Logger('Machine');
logger.info(`Hostname: ${os.hostname()}`); logger.info(`Hostname: ${os.hostname()}`);
logger.info(`Platform: ${process.platform}`); logger.info(`Platform: ${process.platform}`);
logger.info(`Architecture: ${process.arch}`); logger.info(`Architecture: ${process.arch}`);
logger.info(`CPU: ${os.cpus().length} core`); logger.info(`CPU: ${os.cpus().length} core`);
logger.info(`MEM: ${totalmem}GB (available: ${freemem}GB)`); const mem = await sysUtils.mem();
const totalmem = (mem.total / 1024 / 1024 / 1024).toFixed(1);
const availmem = (mem.available / 1024 / 1024 / 1024).toFixed(1);
logger.info(`MEM: ${totalmem}GB (available: ${availmem}GB)`);
} }
} }