mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-12 21:53:09 +02:00
14 lines
427 B
TypeScript
14 lines
427 B
TypeScript
|
import * as os from 'os';
|
||
|
import Logger from './logger';
|
||
|
|
||
|
export default class MachineInfo {
|
||
|
static show() {
|
||
|
const totalmem = (os.totalmem() / 1024 / 1024 / 1024).toFixed(1);
|
||
|
const freemem = (os.freemem() / 1024 / 1024 / 1024).toFixed(1);
|
||
|
let logger = new Logger('Machine');
|
||
|
logger.info(os.hostname());
|
||
|
logger.info(`CPU: ${os.cpus().length}core`);
|
||
|
logger.info(`MEM: ${totalmem}GB (available: ${freemem}GB)`);
|
||
|
}
|
||
|
}
|