From 6ef05c8ae941a8806664c09a226d0fb44bfd2471 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Wed, 31 Mar 2021 20:02:35 -0600 Subject: [PATCH] ram usage stats --- commands/misc/info.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commands/misc/info.js b/commands/misc/info.js index 1169398..57460c5 100644 --- a/commands/misc/info.js +++ b/commands/misc/info.js @@ -1,5 +1,6 @@ const Discord = require("discord.js"); const moment = require('moment'); +const os = require('os'); const UserData = require('../../models/user'); @@ -26,6 +27,7 @@ module.exports = { .addField("Restarts", botData.restarts, true) .addField("Commands Executed", `${botData.commands}${user ? `\nYou: **${user.commands}**|**${Math.floor((user.commands / botData.commands) * 100)}%**` : ''}`, true) .addField("Last Restart", moment(botData.lastRestart).fromNow(), true) + .addField("Mem", `\`${process.memoryUsage().heapUsed / 1024 / 1024}MB\` heap of \`${process.memoryUsage().heapTotal / 1024 / 1024}MB\` allocated. | **${Math.floor((process.memoryUsage().heapTotal / process.memoryUsage().heapUsed) * 100)}%**\nTotal RAM: \`${os.totalmem() / 1024 / 1024 / 1024}GB\` | Free RAM: \`${os.freemem() / 1024 / 1024 / 1024}GB\``, true) .setColor("c375f0") .setFooter("Natsuki") .setTimestamp());