MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / gcPhaseSummary

Function gcPhaseSummary

dashboard/lcm/src/StoreHealth.tsx:72–92  ·  view source on GitHub ↗
(report: GcReport | null)

Source from the content-addressed store, hash-verified

70}
71
72function gcPhaseSummary(report: GcReport | null): string {
73 if (!report) return "";
74 const parts: string[] = [];
75 const phases: Array<[string, GcPhase | null | undefined]> = [
76 ["orphans", report.orphans],
77 ["unreferenced", report.unreferenced],
78 ["missing", report.missing],
79 ["dangling", report.dangling],
80 ];
81 for (const [name, phase] of phases) {
82 if (phase && phase.count) {
83 parts.push(
84 `${name}=${fmtInt(phase.count)}${phase.bytes ? ` (${fmtBytes(phase.bytes)})` : ""}`,
85 );
86 }
87 }
88 if (report.deferred && report.deferred.count) {
89 parts.push(`deferred=${fmtInt(report.deferred.count)}`);
90 }
91 return parts.length ? parts.join(" · ") : "nothing to reclaim";
92}
93
94export function StoreHealthCard(): React.ReactElement {
95 const [health, setHealth] = useState<PayloadHealthResponse | null>(null);

Callers 1

StoreHealthCardFunction · 0.85

Calls 3

fmtIntFunction · 0.90
fmtBytesFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected