diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-12 23:18:18 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-12 23:18:18 +0300 |
| commit | d199899dc1460d9dd72c6fca343f0030d632a635 (patch) | |
| tree | d59a43f2c25727ca296b74c8ca5b7387b56e70c6 /internal/statsengine | |
| parent | 119c679dd16d6a3c89b9d37665c44815956b6f82 (diff) | |
add DefaultTopN constant to statsengine and replace hard-coded 64 capacity values
Introduces statsengine.DefaultTopN = 64 as the canonical named constant for
the top-N capacity used when constructing an Engine. Removes the local
defaultEngineCapacity constant from runtime_builder.go and updates all
call sites to reference statsengine.DefaultTopN instead of bare 64.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/statsengine')
| -rw-r--r-- | internal/statsengine/engine.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/statsengine/engine.go b/internal/statsengine/engine.go index 6681c66..78dbe65 100644 --- a/internal/statsengine/engine.go +++ b/internal/statsengine/engine.go @@ -9,7 +9,17 @@ import ( "ior/internal/types" ) -const trendWindowSlots = 20 +const ( + // trendWindowSlots is the number of slots used for trend detection in ring + // time series. Two consecutive windows of this size are compared to detect + // rising, falling, or stable throughput/latency trends. + trendWindowSlots = 20 + + // DefaultTopN is the default maximum number of top entries tracked per + // category (files, processes). It is exported so callers can use it as the + // standard capacity when constructing a new Engine via NewEngine. + DefaultTopN = 64 +) // Engine aggregates streaming syscall data into immutable snapshots. type Engine struct { |
