FABRIC/notes/bf-53q6.md
jedarden 3e6d348690
Some checks are pending
CI / test (18.x) (push) Waiting to run
CI / test (20.x) (push) Waiting to run
CI / test (22.x) (push) Waiting to run
docs(bf-53q6): note that feature was already complete
2026-06-07 10:29:30 -04:00

2.1 KiB

System Cgroup Memory Panel - Already Complete

Status

The system cgroup memory panel feature was already fully implemented in prior commits.

Implementation Summary

Backend (Completed)

  • API Endpoints (src/web/server.ts, lines 1619-1664):

    • GET /api/system/memory - Current memory status with formatted values
    • GET /api/system/memory/history - 5-minute history (30 samples @ 10s intervals)
    • GET /api/system/memory/summary - Human-readable summary
    • GET /api/alerts/oom - OOM risk assessment
  • Cgroup Monitor (src/systemCgroupMonitor.ts):

    • Reads from /sys/fs/cgroup/user.slice/user-1001.slice/memory.*
    • Tracks memory.current, memory.high, memory.max, memory.swap.current
    • Parses oom_kill counter from memory.events
    • Maintains 30-sample history for sparkline visualization
    • Background sampler running at 10s intervals

Frontend (Completed)

  • SystemMemoryPanel.tsx (703 lines):

    • Full-featured panel with real-time memory visualization
    • 5-minute sparkline with color-coded bars (green/yellow/red)
    • Progress bar showing cgroup usage vs limit with dynamic coloring
    • OOM kill counter display
    • Swap usage section with progress bar
    • System memory, FABRIC process RSS sections
    • OOM risk levels legend
  • SystemMemoryIndicator.tsx (259 lines):

    • Compact indicator for fleet header
    • Progress bar with color coding
    • Mini sparkline (30 samples)
    • OOM kill counter badge
    • Swap indicator icon
  • Integration (App.tsx):

    • Indicator in fleet-header (line 928)
    • Panel toggle button in header (lines 871-878)
    • Full panel rendered when active (lines 1122-1127)

Requirements Met

Current cgroup memory usage vs MemoryHigh (progress bar: green <70%, yellow 70-90%, red >90%) 5-minute sparkline of memory.current sampled every 10s oom_kill counter from memory.events Swap usage if enabled Backend GET /api/system/memory endpoint React component alongside fleet summary bar

  • 83baf06 feat(bf-53q6): integrate SystemMemoryPanel into FABRIC web dashboard
  • 81b57e6 refactor(bf-53q6): add SystemMemoryIndicator to fleet header and clean up cgroup monitor