mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
FIX: miscalculation of the mean value
This commit is contained in:
+1
-1
@@ -40,7 +40,7 @@ func (s *GorStat) Write(latest int) {
|
||||
s.max = latest
|
||||
}
|
||||
if latest != 0 {
|
||||
s.mean = (s.mean + latest) / 2
|
||||
s.mean = ((s.mean * s.count) + latest) / (s.count + 1)
|
||||
}
|
||||
s.latest = latest
|
||||
s.count = s.count + 1
|
||||
|
||||
Reference in New Issue
Block a user