Skip to content

Commit e13aaa1

Browse files
author
poolqa
committed
fix summary error
1 parent 26239a9 commit e13aaa1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

performance/statistics.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type StatisticsTime struct {
1919
//AvgTime time.Duration
2020
MaxTime time.Duration
2121
MinTime time.Duration
22-
Count int64
22+
Count int64
2323
}
2424

2525
func (stat *StatisticsTime) AddStatisticsTime(src *StatisticsTime) {
@@ -43,7 +43,7 @@ func (stat *StatisticsTime) SetTime(src time.Duration) {
4343
stat.MaxTime = src
4444
stat.MinTime = src
4545
} else {
46-
stat.SumTime.Add(decimal.NewFromInt(int64(src)))
46+
stat.SumTime = stat.SumTime.Add(decimal.NewFromInt(int64(src)))
4747
if src > stat.MaxTime {
4848
stat.MaxTime = src
4949
}
@@ -59,4 +59,4 @@ func (stat *StatisticsTime) GetAvg() time.Duration {
5959
return 0
6060
}
6161
return time.Duration(stat.SumTime.Div(decimal.NewFromInt(stat.Count)).IntPart())
62-
}
62+
}

0 commit comments

Comments
 (0)