summaryrefslogtreecommitdiff
path: root/src/utils/machineInfo.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/machineInfo.ts')
-rw-r--r--src/utils/machineInfo.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/machineInfo.ts b/src/utils/machineInfo.ts
new file mode 100644
index 0000000000..600460e4da
--- /dev/null
+++ b/src/utils/machineInfo.ts
@@ -0,0 +1,13 @@
+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)`);
+ }
+}