Historical Rolling Trend Charts (Swift Charts Engine) #23
Notifications
Due Date
No due date set.
Depends on
Reference: gronod/MacMonitor#23
Reference in New Issue
Block a user
Resolved in Milestone 4 via commit
7d2dd30ondevelop.RollingRingBuffer<T>with capacity bounds and oldest sample eviction.TelemetryHistoryStoreto buffer rolling historical samples across CPU load, memory, network I/O, disk I/O, thermals, and power.TelemetryTrendChartViewleveraging Swift Charts (LineMarkandAreaMarkwith gradient fills and live stat tags).ContentView.swiftunder the "Historical Trends" tab.MMHistoryTests.swift.Technical Implementation Plan & Code Solution
1. Rolling Time-Series Data Architecture
Visualizing 60-second to 1-hour timelines without continuous heap allocation requires a high-performance circular ring buffer:
O(1)appending.LineMarkwith gradientAreaMark.2. Ring Buffer Implementation (
RingBuffer.swift)3. Swift Charts Component (
TelemetryTrendChart.swift)4. GPU Rendering Performance
By rendering immutable arrays extracted from the ring buffer on
@MainActor, Swift Charts utilizes Metal-backed rasterization without blocking background telemetry sampling threads.