nextReport compute the next report time based on the interval. The interval is based off the creation of the cluster seed to avoid all cluster reporting at the same time.
(interval time.Duration, createdAt, now time.Time)
| 309 | // nextReport compute the next report time based on the interval. |
| 310 | // The interval is based off the creation of the cluster seed to avoid all cluster reporting at the same time. |
| 311 | func nextReport(interval time.Duration, createdAt, now time.Time) time.Time { |
| 312 | // createdAt * (x * interval ) >= now |
| 313 | return createdAt.Add(time.Duration(math.Ceil(float64(now.Sub(createdAt))/float64(interval))) * interval) |
| 314 | } |