Summary
Consolidate load_average_history class with time_series_buffer<T> template to eliminate code duplication.
Parent Issue
Part of #309 (Consolidate buffering layer - C++20 Module preparation)
Current State
time_series_buffer.h contains two nearly identical implementations:
time_series_buffer<T>: Generic time-series buffer for arithmetic types
load_average_history: Specialized buffer for load average (3 double values)
Problem
- Both classes share ~90% identical code structure (ring buffer logic, statistics calculation)
- Violates Kent Beck's "No Duplication" principle
- Makes maintenance harder - bug fixes must be applied twice
Proposed Solution
- Create
multi_value_time_series_buffer<T, N> template or similar for multi-field samples
- Refactor
load_average_history to use the new template or a specialized time_series_buffer
- Mark old API as deprecated (if breaking changes not allowed)
Acceptance Criteria
Files Affected
include/kcenon/monitoring/utils/time_series_buffer.h
include/kcenon/monitoring/collectors/system_resource_collector.h
tests/test_time_series_buffer.cpp
Summary
Consolidate
load_average_historyclass withtime_series_buffer<T>template to eliminate code duplication.Parent Issue
Part of #309 (Consolidate buffering layer - C++20 Module preparation)
Current State
time_series_buffer.hcontains two nearly identical implementations:time_series_buffer<T>: Generic time-series buffer for arithmetic typesload_average_history: Specialized buffer for load average (3 double values)Problem
Proposed Solution
multi_value_time_series_buffer<T, N>template or similar for multi-field samplesload_average_historyto use the new template or a specializedtime_series_bufferAcceptance Criteria
load_average_historyfunctionality preservedsystem_resource_collectorcontinues to workFiles Affected
include/kcenon/monitoring/utils/time_series_buffer.hinclude/kcenon/monitoring/collectors/system_resource_collector.htests/test_time_series_buffer.cpp