I am using python to increment a counter in 5 minute intervals in redis and speed of the execution code is rather important. I will have a sorted set that will look like this:
1:30 incr 1:35 incr ...
where the incr is the hit count between that 5 minute interval.
Lets say I am at 1:32 pm and I want to place all of the hits between 1:30 and 1:35 in that bucket.
Naively I can just loop through a list and check if minute between 30 and 35 and place in the 1:30 bucket. Is there a more pythonic method to do this?
Output: