FIX: miscalculation of the mean value

This commit is contained in:
myzhan
2018-08-08 17:23:33 +05:00
committed by Leonid Bugaev
parent f85bb29327
commit 9fd7a46e7e
+1 -1
View File
@@ -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