Compare commits

..

2 Commits

Author SHA1 Message Date
Hri7566 f7490c1190 Memory command 2024-02-22 22:25:33 -05:00
Hri7566 ae1f032cad oot 2024-02-22 21:49:31 -05:00
3 changed files with 21 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import { inventory } from "./inventory/inventory";
import { eat } from "./inventory/eat";
import { sack } from "./inventory/sack";
import { reel } from "./fishing/reel";
import { memory } from "./util/mem";
interface ICommandGroup {
id: string;
@ -48,7 +49,7 @@ commandGroups.push(inventoryGroup);
const utilGroup: ICommandGroup = {
id: "util",
displayName: "Utility",
commands: [data, setcolor]
commands: [data, setcolor, memory]
};
commandGroups.push(utilGroup);

View File

@ -6,7 +6,7 @@ import { CosmicColor } from "@util/CosmicColor";
export const eat = new Command(
"eat",
["eat"],
["eat", "oot"],
"Eat literally anything in your inventory",
"eat <something>",
"command.inventory.eat",

View File

@ -0,0 +1,18 @@
import Command from "@server/commands/Command";
export const memory = new Command(
"memory",
["memory", "mem"],
"View memory usage",
"memory",
"command.util.memory",
async () => {
const mem = process.memoryUsage();
return `Memory: ${(mem.heapUsed / 1024 / 1024).toFixed(2)}m / ${(
mem.heapTotal /
1024 /
1024
).toFixed(2)}m / ${(mem.rss / 1024 / 1024).toFixed(2)}m`;
},
false
);