You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] statsItem.samplingInHour trims the wrong list, so csListDay grows without bound and day-level stats use an ever-growing window #1241
statsItem.samplingInHour() in consumer/statistics.go appends a snapshot to csListDay but trims csListHour:
si.csListDay.PushBack(callSnapshot{...})
ifsi.csListDay.Len() >25 {
si.csListHour.Remove(si.csListDay.Front()) // wrong list
}
container/list.Remove(e) is a no-op when e does not belong to that list, so nothing is ever removed: csListDay grows by one snapshot per hour per statsItem forever. The sibling methods samplingInSeconds/samplingInMinutes push and trim the same list, which shows this is a copy-paste slip.
Steps to Reproduce
Call samplingInHour() 30 times on a fresh statsItem; csListDay.Len() is 30 instead of the intended cap 25.
What Did You Expect to See?
csListDay capped at 25 entries (a ~25-hour sliding window for the day-level stats).
What Did You See Instead?
Unbounded growth (slow memory leak, one snapshot per hour per topic/group statsItem), and getStatsDataInDay() computes over an ever-growing window instead of the intended ~25-hour one, skewing day-level TPS/AVGPT.
Additional Context
Fix incoming: si.csListDay.Remove(si.csListDay.Front()), aligning with the sibling sampling methods; includes a regression test.
Activity