Implement power of two size suffies for memory

Memory sizes are usually written using the prefixes with a base of 1024
instead of 1000.  Implment formatting of the power of two based prefixes
for displaying memory sizes.
This commit is contained in:
Hornwitser committed 2024-01-14 09:57:44 +01:00
1 parent d64bf6015e
commit ae2c5cf98e
3 files changed
+60 -7

No files matched your search

@@ -32,8 +32,8 @@ export function MetricMemoryUsed(props: { metrics?: lib.SystemMetrics }) {
if (!props.metrics) {
return "N/A";
}
const used = lib.formatBytes(props.metrics.memoryUsed);
const capacity = lib.formatBytes(props.metrics.memoryCapacity);
const used = lib.formatBytes(props.metrics.memoryUsed, "binary");
const capacity = lib.formatBytes(props.metrics.memoryCapacity, "binary");
return `${used} / ${capacity}`;
}