wang-jiahua opened a new pull request, #1242:
URL: https://github.com/apache/rocketmq-client-go/pull/1242

   ### Which Issue(s) This PR Fixes
   
   Fixes #1241
   
   ### Brief Description
   
   `samplingInHour()` pushes each snapshot into `csListDay` but trims 
`csListHour`. Since `container/list.Remove` is a no-op for an element that 
belongs to another list, `csListDay` is never trimmed: it grows by one snapshot 
per hour per statsItem forever (slow leak), and `getStatsDataInDay()` ends up 
computing over an ever-growing window instead of the intended ~25-hour one. The 
sibling methods `samplingInSeconds`/`samplingInMinutes` push and trim the same 
list, so this is a one-line copy-paste slip: `csListHour` → `csListDay`.
   
   ### How Did You Test This Change?
   
   - New regression test `TestSamplingInHourTrimsDayList`: 30 calls on a fresh 
statsItem — unfixed yields `csListDay.Len()==30` (never trimmed, FAIL), fixed 
yields 25 (PASS).
   - Existing consumer statistics tests 
(PullRT/PullTPS/ConsumeOKTPS/ConsumeFailedTPS/GetConsumeStatus and the 
stats-manager soak) all pass; `gofmt -l` clean; `go vet` reports nothing new on 
the touched files.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to