MCPcopy Create free account
hub / github.com/anus-dev/ANUS / formatMemoryUsage

Function formatMemoryUsage

packages/core/src/utils/formatters.ts:8–17  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

6 */
7
8export const formatMemoryUsage = (bytes: number): string => {
9 const gb = bytes / (1024 * 1024 * 1024);
10 if (bytes < 1024 * 1024) {
11 return `${(bytes / 1024).toFixed(1)} KB`;
12 }
13 if (bytes < 1024 * 1024 * 1024) {
14 return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
15 }
16 return `${gb.toFixed(2)} GB`;
17};

Callers 1

executeMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected