Document profiler log_current_tasks (#32520)

This commit is contained in:
J. Nick Koston 2024-04-29 10:04:01 -05:00 committed by GitHub
parent aaa27b36e6
commit 23033b454c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -199,3 +199,15 @@ Logs statistics from [lru_cache](https://docs.python.org/3/library/functools.htm
| `enabled` | yes | Boolean to enable asyncio debug. |
When `set_asyncio_debug` is enabled, `asyncio` will run in [debug mode](https://docs.python.org/3/library/asyncio-dev.html#debug-mode). Use this service to help identify an integration that is blocking the event loop.
### Service profiler.log_current_tasks
{% my developer_call_service badge service="profiler.log_current_tasks" %}
This service can help track down task leaks, or find tasks that are delaying startup.
An example is below:
```txt
[homeassistant.components.profiler] Task: <Task pending name='Task-1133' coro=<HubConnector._listener() running at /usr/local/lib/python3.12/site-packages/aioharmony/hubconnector_websocket.py:362> wait_for=<Future pending cb=[Task.task_wakeup()]>>
```