import { GaugeCard } from "./GaugeCard.js"; import { fmt } from "../../utils/units.js"; import type { MonitoringSample } from "../../types.js"; interface Props { monitor: MonitoringSample | null; history: MonitoringSample[]; } function pluck( history: MonitoringSample[], key: K, ): number[] { return history.map((s) => (s[key] as number | null) ?? 0); } export function PerformanceMonitor({ monitor, history }: Props) { const memUsed = monitor?.mem_used_mib ?? null; const memTotal = monitor?.mem_total_mib ?? null; const memLabel = memUsed != null && memTotal != null ? `${memUsed.toFixed(0)} / ${memTotal.toFixed(0)} MiB` : "—"; return (
Live Monitor
); }