minRingSize calculate how many DataPoint we need to have in a ring buffer in order to provide aggregate values over 1 minute
(configuredRingSize int, interval time.Duration)
| 133 | // function to get PHC freq from configured PHC device |
| 134 | getPHCFreqPPB func() (float64, error) |
| 135 | } |
| 136 | |
| 137 | // minRingSize calculate how many DataPoint we need to have in a ring buffer |
| 138 | // in order to provide aggregate values over 1 minute |
| 139 | func minRingSize(configuredRingSize int, interval time.Duration) int { |
| 140 | size := configuredRingSize |
| 141 | if time.Duration(size)*interval < time.Minute { |
| 142 | size = int(math.Ceil(float64(time.Minute) / float64(interval))) |
| 143 | } |
| 144 | return size |
searching dependent graphs…