72
// So, if you want 300 seconds of history on an event that records 1k counts/sec, 3 10-second windows
73
// is fine.
75
>
if cfg.WindowCount <= 0 {
76
return nil, errors.New("windowCount must be non-negative")
77
}
79
return nil, errors.New("probable misconfiguration detected: windowSize is too small, consider increasing it to at least 50ms")
80
}
82
>
windows: make([]timedWindow, cfg.WindowCount),
83
>
cfg: cfg,
84
>
// mu and head both empty
85
>
}, nil
86
}
87