fix rolling window bug (#340)

This commit is contained in:
zjbztianya
2021-01-03 20:27:47 +08:00
committed by GitHub
parent 5bc01e4bfd
commit 2ee95f8981
2 changed files with 26 additions and 1 deletions

View File

@@ -96,7 +96,7 @@ func (rw *RollingWindow) updateOffset() {
}
rw.offset = (offset + span) % rw.size
rw.lastTime = timex.Now()
rw.lastTime = time.Duration(int(rw.lastTime) + int(rw.interval)*span)
}
type Bucket struct {