MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cpuText

Function cpuText

graph-ui/src/system/system-model.ts:4–9  ·  view source on GitHub ↗
(value: number | null | undefined, unit: ProcessCpuUnit | undefined)

Source from the content-addressed store, hash-verified

2import { countedDetail, repeatCount } from '../app/ui-log';
3
4export function cpuText(value: number | null | undefined, unit: ProcessCpuUnit | undefined): string {
5 if (value == null || !Number.isFinite(value) || value < 0) return 'Unavailable';
6 if (unit === 'percent') return `${value.toFixed(1)}%`;
7 if (unit === 'seconds') return `${value.toFixed(1)} s total`;
8 return 'Unit unavailable';
9}
10
11export function memoryText(value: number | null | undefined): string {
12 return value == null || !Number.isFinite(value) || value < 0 ? 'Unavailable' : `${value.toFixed(1)} MiB`;

Callers 2

SystemWorkspaceFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected