MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / convertBytes

Function convertBytes

console/src/utils/format.ts:63–76  ·  view source on GitHub ↗
(bytes: number, unit: ByteUnit)

Source from the content-addressed store, hash-verified

61};
62
63export function convertBytes(bytes: number, unit: ByteUnit) {
64 switch (unit) {
65 case "B":
66 return bytes;
67 case "KB":
68 return bytes / Number(kilobyte);
69 case "MB":
70 return bytes / Number(megabyte);
71 case "GB":
72 return bytes / Number(gigabyte);
73 case "TB":
74 return bytes / Number(terabyte);
75 }
76}
77
78export function formatMemoryUsage(
79 memoryStats:

Callers 2

formatValueFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected