2.1 KiB
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 valuesGET /api/system/memory/history- 5-minute history (30 samples @ 10s intervals)GET /api/system/memory/summary- Human-readable summaryGET /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
- Reads from
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