[observer] storage bounds: drop min/max columns + cap points per series#50449
Draft
Eokye wants to merge 2 commits intoeokye/performancefrom
Draft
[observer] storage bounds: drop min/max columns + cap points per series#50449Eokye wants to merge 2 commits intoeokye/performancefrom
Eokye wants to merge 2 commits intoeokye/performancefrom
Conversation
Two changes to bound storage memory: 1. Remove mins/maxes columnar arrays from seriesStats. No active detector uses AggregateMin or AggregateMax — BOCPD, ScanWelch, ScanMW, and RRCF all use Average+Count only. Saves 16 bytes per point (40→24). The aggregate constants remain for API compatibility; they return 0. 2. Add maxPointsPerSeries (default 600 in live mode, unlimited in tests). When a new point would exceed the cap, the oldest points are trimmed from the front of the columnar arrays. At 1Hz this retains 10 minutes of history — sufficient for ScanWelch (MinPoints=30) and BOCPD (purely incremental, doesn't re-read history). Prevents unbounded growth in long-running agents.
Contributor
Gitlab CI Configuration Changes
|
| Removed | Modified | Added | Renamed |
|---|---|---|---|
| 0 | 361 | 0 | 0 |
Updated: .gitlab/distribution.yml
Changes Summary
| Removed | Modified | Added | Renamed |
|---|---|---|---|
| 0 | 0 | 2 | 0 |
ℹ️ Diff available in the job log.
Contributor
Go Package Import DifferencesBaseline: e5b320d
|
Contributor
Static quality checks❌ Please find below the results from static quality gates Error
Gate failure full details
Static quality gates prevent the PR to merge! Successful checksInfo
On-wire sizes (compressed)
|
Re-slicing (s[trim:]) keeps the original backing array alive because the new slice still references into it. Allocate fresh right-sized slices and copy the live portion so the old arrays become unreferenced and the GC can reclaim them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #50395. Two changes to bound per-series storage memory:
1. Drop unused min/max columns
Remove
minsandmaxescolumnar arrays fromseriesStats. No active detector usesAggregateMinorAggregateMax— BOCPD, ScanWelch, ScanMW, and RRCF all operate on Average+Count only. Saves 16 bytes per point (40→24 bytes). The aggregate enum values remain for API compatibility; they return 0.2. Cap points per series (
maxPointsPerSeries = 600)When a new point would exceed the cap, the oldest points are trimmed from the front of the columnar arrays. At 1Hz this retains 10 minutes of history — sufficient for:
MinPoints=30, gets 20× headroomThis prevents unbounded columnar growth in long-running agents. Previously, a steady-state series would grow by one row per second forever.
Impact
unbounded × 40 bytes/point→600 × 24 bytes = 14.4 KBSMP results
Baseline: 7.78.0. Experiment:
observer_logs_anomaly_stress(ScanWelch enabled, BOCPD+RRCF disabled, logs agent off).Commit 1: drop min/max + cap points (re-slice trim) —
f112ca04Run ID:
8fd945f0-1024-4b58-966c-99290d3985c1Commit 2: copy-on-trim to release old backing arrays —
d9106dc8Run ID:
8601e3b2-91e4-4024-b6eb-cc55bef17ac7Reference: Batch 3 (no storage bounds) —
1a99bc9bRun ID:
e862928e-7c6d-4f55-9e18-8bc8990981a5Test plan
dda inv test --targets=./comp/observer/impl/...— all 600 tests pass