element-synapse/tests/federation
Erik Johnston 5408101d21
Speed up pruning of ratelimiter (#19129)
I noticed this in some profiling. Basically, we prune the ratelimiters
by copying and iterating over every entry every 60 seconds. Instead,
let's use a wheel timer to track when we should potentially prune a
given key, and then we a) check fewer keys, and b) can run more
frequently. Hopefully this should mean we don't have a large pause
everytime we prune a ratelimiter with lots of keys.

Also fixes a bug where we didn't prune entries that were added via
`record_action` and never subsequently updated. This affected the media
and joins-per-room ratelimiter.
2025-11-04 12:44:57 +00:00
..
transport Use type hinting generics in standard collections (#19046) 2025-10-22 16:48:19 -05:00
__init__.py Implementation of server_acls 2018-07-04 19:06:20 +01:00
test_complexity.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_federation_catch_up.py Use type hinting generics in standard collections (#19046) 2025-10-22 16:48:19 -05:00
test_federation_client.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
test_federation_devices.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
test_federation_media.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
test_federation_out_of_band_membership.py Use type hinting generics in standard collections (#19046) 2025-10-22 16:48:19 -05:00
test_federation_sender.py Use type hinting generics in standard collections (#19046) 2025-10-22 16:48:19 -05:00
test_federation_server.py Speed up pruning of ratelimiter (#19129) 2025-11-04 12:44:57 +00:00