Skip to content

Commit d608268

Browse files
Alipebtbinbin0325
authored andcommitted
Improve bucket reset mechanism of MetricBucket (alibaba#521)
Signed-off-by: Alipebt <1160756683@qq.com>
1 parent 40bdf75 commit d608268

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/stat/base/bucket_leap_array.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ func (bla *BucketLeapArray) NewEmptyBucket() interface{} {
3838

3939
func (bla *BucketLeapArray) ResetBucketTo(bw *BucketWrap, startTime uint64) *BucketWrap {
4040
atomic.StoreUint64(&bw.BucketStart, startTime)
41-
bw.Value.Store(NewMetricBucket())
41+
mb := bw.Value.Load().(*MetricBucket)
42+
mb.reset()
4243
return bw
4344
}
4445

0 commit comments

Comments
 (0)