Skip to content

refactor(buffer): make buffering_strategy use ring_buffer internally#316

Merged
kcenon merged 1 commit into
mainfrom
refactor/312-buffering-strategy-use-ring-buffer
Jan 3, 2026
Merged

refactor(buffer): make buffering_strategy use ring_buffer internally#316
kcenon merged 1 commit into
mainfrom
refactor/312-buffering-strategy-use-ring-buffer

Conversation

@kcenon

@kcenon kcenon commented Jan 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Refactor fixed_size_strategy, time_based_strategy, and adaptive_strategy to use ring_buffer<buffered_metric> for internal storage instead of std::vector
  • Add detail::next_power_of_two() helper function for ring_buffer capacity calculation
  • Maintain priority_based_strategy with vector-based storage (requires sorting/selective deletion operations not supported by ring_buffer)
  • Update internal include paths to use relative paths for internal headers

Changes

File Change
src/utils/buffering_strategy.h Refactored strategies to use ring_buffer, added helper function
src/utils/buffer_manager.h Updated include paths
src/utils/metric_storage.h Updated include paths
src/utils/time_series.h Updated include paths
tests/test_buffering_strategies.cpp Updated include paths
docs/CHANGELOG.md Added changelog entry
docs/CHANGELOG_KO.md Added Korean changelog entry

Test plan

  • Clean build passes
  • All 49 integration tests pass
  • No breaking changes to public API

Related Issues

Closes #312

…312)

- Refactor fixed_size_strategy, time_based_strategy, and adaptive_strategy
  to use ring_buffer<buffered_metric> for internal storage
- Add detail::next_power_of_two() helper for ring_buffer capacity calculation
- Keep priority_based_strategy with vector-based storage (requires sorting)
- Update internal include paths to use relative paths for internal headers
- Update test file include paths for consistency
- Update CHANGELOG with changes
@kcenon kcenon merged commit 7a26a25 into main Jan 3, 2026
21 checks passed
@kcenon kcenon deleted the refactor/312-buffering-strategy-use-ring-buffer branch January 3, 2026 09:05
kcenon added a commit that referenced this pull request Apr 13, 2026
…312) (#316)

- Refactor fixed_size_strategy, time_based_strategy, and adaptive_strategy
  to use ring_buffer<buffered_metric> for internal storage
- Add detail::next_power_of_two() helper for ring_buffer capacity calculation
- Keep priority_based_strategy with vector-based storage (requires sorting)
- Update internal include paths to use relative paths for internal headers
- Update test file include paths for consistency
- Update CHANGELOG with changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] Make buffering_strategy use ring_buffer

1 participant