From dcb16831e87e519a1b37e904a0393a29bc1b8dcb Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 8 Jul 2022 17:23:41 +0100 Subject: Move comment translating between bucket terminology --- synapse/api/ratelimiting.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/synapse/api/ratelimiting.py b/synapse/api/ratelimiting.py index 92c2f3b42a..930e96369d 100644 --- a/synapse/api/ratelimiting.py +++ b/synapse/api/ratelimiting.py @@ -27,6 +27,9 @@ class Ratelimiter: """ Ratelimit actions marked by arbitrary keys. + (Note that the source code speaks of "actions" and "burst_count" rather than + "tokens" and a "bucket_size".) + This is a "leaky bucket as a meter". For each key to be tracked there is a bucket containing some number 0 <= T <= `burst_count` of tokens corresponding to previously permitted requests for that key. Each bucket starts empty, and gradually leaks @@ -51,9 +54,6 @@ class Ratelimiter: since this time point, and use that to decide if we should accept or reject the request. - Note that the source code speaks of "actions" and "burst_count" rather than "tokens" - and a "bucket_size". - Args: clock: A homeserver clock, for retrieving the current time rate_hz: The long term number of actions that can be performed in a second. -- cgit 1.5.1