mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-24 12:42:49 +00:00
e89f1cec9e
infrastructureSummaryCache.ts and workloadsSummaryCache.ts lost their last readers on 2026-05-26, when the InfrastructureSummary card and the standalone Workloads summary were deleted. Their only remaining caller, the Workloads table history hook, runs both fetchers inside createNonSuspendingQuery, which always passes an abort signal, so the in-flight dedupe was skipped as well. What was left ran on every 30-second Trends poll: serialize the whole response on the main thread, then write it to localStorage or, above the 900k-character cap, delete the key. On the 50-node, 929-guest mock estate that was 9.6 MB of workloads JSON and 0.9 MB of infrastructure JSON per poll (5-31 ms each), thrown away every time. The hook now calls ChartsAPI.getWorkloadCharts and getInfrastructureSummaryCharts directly with the same range, signal, maxPoints, node scope and metric list, and the node/agent/Docker-host series fold moves into workloadMetricHistoryModel. The query layer already retains reads across remounts for five minutes and clears them on org switch, so nothing else changes for users. A before/after run on embedded builds showed the same chart requests and sparklines on every node and guest row, with no storage traffic and no multi-megabyte serialization afterwards. The hook takes the deleted cache's place under the workloads-hot-path policy. The subsystem contracts still described InfrastructureSummary, its model and state hook, the shared summary table, selector and details drawer, WorkloadsSummary, throughputPresentation and the two caches as live owners. Those clauses now name the live owner (useWorkloadTableMetricHistory, ProxmoxNodesTable, nodeFromResource, ResponsiveMetricCell, storageSummaryCache, summaryTableFocus), become conditional rules, or are removed where nothing they govern remains.