I have a log file that contains an hour's worth of data.
I'd like to generate an alert if there are more than N errors recorded within any 5-minute period within that log.
What I don't want to do is designate 5-minute periods (e.g. 00-05, 06-10, etc.) and iterate through them, because if N=10, and I have 8 errors at 04 and 8 errors at 07, they'll be treated as in two separate buckets and won't generate the alert.
I suppose I could instead iterate 60 times, advancing 1 minute each time, and consider the 5-minute bucket from that point, but is there a more elegant or more performant way?