core/homeassistant/helpers
J. Nick Koston b574220247
Refactor rate limit helper to track time in seconds (#113898)
* Refactor rate limit helper to track time in seconds

Currently we created datetime and timedelta objects to enforce the
rate limit. When the rate limit was being hit hard, this got expensive.

We now use floats everywhere instead as they are much cheaper which
is important when we are running up against a rate limit, which is
by definition a hot path

The rate limit helper is currently only used for templates and
we do not have any code in the code base that directly passes
in a rate limit so the impact to custom components is expected
to be negligible if any

* misesd two
2024-03-20 19:49:37 -04:00
..
service_info Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
__init__.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
aiohttp_client.py Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
area_registry.py Avoid creating unneeded Context and Event objects when firing events (#113798) 2024-03-20 09:40:06 +01:00
category_registry.py Add category registry (#110897) 2024-03-15 13:25:16 +01:00
check_config.py Migrate remaining call in check_config helper to use async_get_component (#113123) 2024-03-11 15:56:24 -10:00
collection.py Improve loops and lists (#113269) 2024-03-14 10:22:20 +01:00
condition.py Clean up unneeded ruff noqa directives (#113616) 2024-03-16 09:48:37 -10:00
config_entry_flow.py Await discovery_function in the DiscoveryFlowHandler instead of wrapping it in a task (#113115) 2024-03-11 21:37:03 -04:00
config_entry_oauth2_flow.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
config_validation.py Add labels to service target (#113753) 2024-03-18 22:32:23 +01:00
data_entry_flow.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
debounce.py Add the ability to create Debouncer tasks as background tasks (#113128) 2024-03-12 08:41:12 -04:00
deprecation.py Clean up unneeded ruff noqa directives (#113616) 2024-03-16 09:48:37 -10:00
device_registry.py Cache parsing the url for the device registry (#113910) 2024-03-20 19:35:01 -04:00
discovery.py Run coroutines as eager tasks in async_run_hass_job (#111683) 2024-03-11 20:05:08 -04:00
discovery_flow.py Use run_immediately for starting discovery at the started event (#113112) 2024-03-11 14:29:39 -10:00
dispatcher.py Run coroutines as eager tasks in async_run_hass_job (#111683) 2024-03-11 20:05:08 -04:00
entity.py Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
entity_component.py Run entity component shutdown immediately (#113635) 2024-03-16 14:42:36 -10:00
entity_platform.py Refactor integration startup time to show wall clock time (#113707) 2024-03-18 21:45:34 -04:00
entity_registry.py Avoid creating unneeded Context and Event objects when firing events (#113798) 2024-03-20 09:40:06 +01:00
entity_values.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
entityfilter.py Improve loops and lists (#113269) 2024-03-14 10:22:20 +01:00
event.py Refactor rate limit helper to track time in seconds (#113898) 2024-03-20 19:49:37 -04:00
floor_registry.py Replace EventType with Event [missing] (#112753) 2024-03-08 21:56:42 +01:00
frame.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
group.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
http.py Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
httpx_client.py Use more f-strings [ruff] (#112695) 2024-03-08 18:44:42 +01:00
icon.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
importlib.py Add a helper to import modules from the event loop (#113169) 2024-03-14 00:26:33 -04:00
instance_id.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
integration_platform.py Run coroutines as eager tasks in async_run_hass_job (#111683) 2024-03-11 20:05:08 -04:00
intent.py Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
issue_registry.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
json.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
label_registry.py Replace EventType with Event [missing] (#112753) 2024-03-08 21:56:42 +01:00
location.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
network.py Remove deprecated `hass.components` from network helper function (#113615) 2024-03-17 17:42:48 +01:00
normalized_name_base_registry.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
ratelimit.py Refactor rate limit helper to track time in seconds (#113898) 2024-03-20 19:49:37 -04:00
recorder.py Make dataclasses in HA core slotted (#91208) 2023-04-11 07:58:28 -10:00
redact.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
registry.py Fix delayed registry check to only using the short delay at running (#113471) 2024-03-14 15:11:09 -10:00
reload.py Switch the reload helper to use async_get_component (#113126) 2024-03-11 16:17:07 -10:00
restore_state.py Migrate restore_state shutdown to use run_immediately (#113786) 2024-03-19 08:42:49 +01:00
schema_config_entry_flow.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
script.py Find referenced labels in automations & scripts (#113812) 2024-03-19 16:28:37 +01:00
script_variables.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
selector.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
sensor.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
service.py Add labels to service target (#113753) 2024-03-18 22:32:23 +01:00
signal.py Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
significant_change.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
singleton.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
start.py Run coroutines as eager tasks in async_run_hass_job (#111683) 2024-03-11 20:05:08 -04:00
state.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
storage.py Construct storage data in the executor to avoid blocking the event loop (#113465) 2024-03-14 19:53:11 -04:00
sun.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
system_info.py Fix system_info importing hassio in the event loop (#113903) 2024-03-20 12:06:40 -10:00
temperature.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
template.py Refactor rate limit helper to track time in seconds (#113898) 2024-03-20 19:49:37 -04:00
trace.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
translation.py Avoid creating unneeded Context and Event objects when firing events (#113798) 2024-03-20 09:40:06 +01:00
trigger.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
trigger_template_entity.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
typing.py Add empty line after module docstring [helpers + other] (#112707) 2024-03-08 10:36:11 -05:00
update_coordinator.py Run coordinator shutdown eagerly (#113174) 2024-03-13 17:33:50 +01:00