MCPcopy Create free account
hub / github.com/facebook/time / minRingSize

Function minRingSize

fbclock/daemon/daemon.go:135–141  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
139func 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

Callers 3

TestMinRingSizeFunction · 0.85
NewFunction · 0.85
doWorkMethod · 0.85

Calls 1

DurationMethod · 0.45

Tested by 1

TestMinRingSizeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…