From d199899dc1460d9dd72c6fca343f0030d632a635 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 12 May 2026 23:18:18 +0300 Subject: 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 --- internal/statsengine/engine.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'internal/statsengine/engine.go') 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 { -- cgit v1.2.3