Created
April 4, 2020 19:40
-
-
Save arpitbbhayani/430ab2725851ad1d2fa68b111b715846 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_current_window(key, start_time): | |
ts_data = requests_store.get(key) | |
if not key: | |
return 0 | |
total_requests = 0 | |
for ts, count in ts_data.items(): | |
if ts > start_time: | |
total_requests += count | |
else: | |
del ts_data[ts] | |
return total_requests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment