Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.profiler Namespace Reference

Namespaces

 config_flow
 
 const
 

Functions

def _async_generate_memory_profile (HomeAssistant hass, ServiceCall call)
 
def _async_generate_profile (HomeAssistant hass, ServiceCall call)
 
list[str] _find_backrefs_not_to_self (Any _object)
 
str|None _get_function_absfile (Any func)
 
Generator[None] _increase_repr_limit ()
 
None _log_object_sources (int max_objects, set[int] last_ids, dict[str, int] last_stats)
 
def _log_objects (*_)
 
str _safe_repr (Any obj)
 
def _write_memory_profile (heap, heap_path)
 
def _write_profile (profiler, cprofile_path, callgrind_path)
 
bool async_setup_entry (HomeAssistant hass, ConfigEntry entry)
 
bool async_unload_entry (HomeAssistant hass, ConfigEntry entry)
 

Variables

tuple _KNOWN_LRU_CLASSES
 
 _LOGGER = logging.getLogger(__name__)
 
 _LRU_CACHE_WRAPPER_OBJECT = _lru_cache_wrapper.__name__
 
string _SQLALCHEMY_LRU_OBJECT = "LRUCache"
 
string CONF_ENABLED = "enabled"
 
string CONF_MAX_OBJECTS = "max_objects"
 
string CONF_SECONDS = "seconds"
 
int DEFAULT_MAX_OBJECTS = 5
 
 DEFAULT_SCAN_INTERVAL = timedelta(seconds=30)
 
string LOG_INTERVAL_SUB = "log_interval_subscription"
 
string SERVICE_DUMP_LOG_OBJECTS = "dump_log_objects"
 
string SERVICE_LOG_CURRENT_TASKS = "log_current_tasks"
 
string SERVICE_LOG_EVENT_LOOP_SCHEDULED = "log_event_loop_scheduled"
 
string SERVICE_LOG_THREAD_FRAMES = "log_thread_frames"
 
string SERVICE_LRU_STATS = "lru_stats"
 
string SERVICE_MEMORY = "memory"
 
string SERVICE_SET_ASYNCIO_DEBUG = "set_asyncio_debug"
 
string SERVICE_START = "start"
 
string SERVICE_START_LOG_OBJECT_SOURCES = "start_log_object_sources"
 
string SERVICE_START_LOG_OBJECTS = "start_log_objects"
 
string SERVICE_STOP_LOG_OBJECT_SOURCES = "stop_log_object_sources"
 
string SERVICE_STOP_LOG_OBJECTS = "stop_log_objects"
 
tuple SERVICES
 

Detailed Description

The profiler integration.

Function Documentation

◆ _async_generate_memory_profile()

def homeassistant.components.profiler._async_generate_memory_profile ( HomeAssistant  hass,
ServiceCall  call 
)
private

Definition at line 435 of file __init__.py.

◆ _async_generate_profile()

def homeassistant.components.profiler._async_generate_profile ( HomeAssistant  hass,
ServiceCall  call 
)
private

Definition at line 398 of file __init__.py.

◆ _find_backrefs_not_to_self()

list[str] homeassistant.components.profiler._find_backrefs_not_to_self ( Any  _object)
private

Definition at line 516 of file __init__.py.

◆ _get_function_absfile()

str | None homeassistant.components.profiler._get_function_absfile ( Any  func)
private
Get the absolute file path of a function.

Definition at line 494 of file __init__.py.

◆ _increase_repr_limit()

Generator[None] homeassistant.components.profiler._increase_repr_limit ( )
private
Increase the repr limit.

Definition at line 593 of file __init__.py.

◆ _log_object_sources()

None homeassistant.components.profiler._log_object_sources ( int  max_objects,
set[int]  last_ids,
dict[str, int]   last_stats 
)
private

Definition at line 527 of file __init__.py.

◆ _log_objects()

def homeassistant.components.profiler._log_objects ( _)
private

Definition at line 485 of file __init__.py.

◆ _safe_repr()

str homeassistant.components.profiler._safe_repr ( Any  obj)
private
Get the repr of an object but keep going if there is an exception.

We wrap repr to ensure if one object cannot be serialized, we can
still get the rest.

Definition at line 504 of file __init__.py.

◆ _write_memory_profile()

def homeassistant.components.profiler._write_memory_profile (   heap,
  heap_path 
)
private

Definition at line 481 of file __init__.py.

◆ _write_profile()

def homeassistant.components.profiler._write_profile (   profiler,
  cprofile_path,
  callgrind_path 
)
private

Definition at line 470 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.profiler.async_setup_entry ( HomeAssistant  hass,
ConfigEntry   entry 
)
Set up Profiler from a config entry.

Definition at line 82 of file __init__.py.

◆ async_unload_entry()

bool homeassistant.components.profiler.async_unload_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Unload a config entry.

Definition at line 388 of file __init__.py.

Variable Documentation

◆ _KNOWN_LRU_CLASSES

tuple homeassistant.components.profiler._KNOWN_LRU_CLASSES
private
Initial value:
1 = (
2  "EventDataManager",
3  "EventTypeManager",
4  "StatesMetaManager",
5  "StateAttributesManager",
6  "StatisticsMetaManager",
7 )

Definition at line 47 of file __init__.py.

◆ _LOGGER

homeassistant.components.profiler._LOGGER = logging.getLogger(__name__)
private

Definition at line 79 of file __init__.py.

◆ _LRU_CACHE_WRAPPER_OBJECT

homeassistant.components.profiler._LRU_CACHE_WRAPPER_OBJECT = _lru_cache_wrapper.__name__
private

Definition at line 44 of file __init__.py.

◆ _SQLALCHEMY_LRU_OBJECT

string homeassistant.components.profiler._SQLALCHEMY_LRU_OBJECT = "LRUCache"
private

Definition at line 45 of file __init__.py.

◆ CONF_ENABLED

string homeassistant.components.profiler.CONF_ENABLED = "enabled"

Definition at line 72 of file __init__.py.

◆ CONF_MAX_OBJECTS

string homeassistant.components.profiler.CONF_MAX_OBJECTS = "max_objects"

Definition at line 74 of file __init__.py.

◆ CONF_SECONDS

string homeassistant.components.profiler.CONF_SECONDS = "seconds"

Definition at line 73 of file __init__.py.

◆ DEFAULT_MAX_OBJECTS

int homeassistant.components.profiler.DEFAULT_MAX_OBJECTS = 5

Definition at line 70 of file __init__.py.

◆ DEFAULT_SCAN_INTERVAL

homeassistant.components.profiler.DEFAULT_SCAN_INTERVAL = timedelta(seconds=30)

Definition at line 68 of file __init__.py.

◆ LOG_INTERVAL_SUB

string homeassistant.components.profiler.LOG_INTERVAL_SUB = "log_interval_subscription"

Definition at line 76 of file __init__.py.

◆ SERVICE_DUMP_LOG_OBJECTS

string homeassistant.components.profiler.SERVICE_DUMP_LOG_OBJECTS = "dump_log_objects"

Definition at line 37 of file __init__.py.

◆ SERVICE_LOG_CURRENT_TASKS

string homeassistant.components.profiler.SERVICE_LOG_CURRENT_TASKS = "log_current_tasks"

Definition at line 42 of file __init__.py.

◆ SERVICE_LOG_EVENT_LOOP_SCHEDULED

string homeassistant.components.profiler.SERVICE_LOG_EVENT_LOOP_SCHEDULED = "log_event_loop_scheduled"

Definition at line 40 of file __init__.py.

◆ SERVICE_LOG_THREAD_FRAMES

string homeassistant.components.profiler.SERVICE_LOG_THREAD_FRAMES = "log_thread_frames"

Definition at line 39 of file __init__.py.

◆ SERVICE_LRU_STATS

string homeassistant.components.profiler.SERVICE_LRU_STATS = "lru_stats"

Definition at line 38 of file __init__.py.

◆ SERVICE_MEMORY

string homeassistant.components.profiler.SERVICE_MEMORY = "memory"

Definition at line 32 of file __init__.py.

◆ SERVICE_SET_ASYNCIO_DEBUG

string homeassistant.components.profiler.SERVICE_SET_ASYNCIO_DEBUG = "set_asyncio_debug"

Definition at line 41 of file __init__.py.

◆ SERVICE_START

string homeassistant.components.profiler.SERVICE_START = "start"

Definition at line 31 of file __init__.py.

◆ SERVICE_START_LOG_OBJECT_SOURCES

string homeassistant.components.profiler.SERVICE_START_LOG_OBJECT_SOURCES = "start_log_object_sources"

Definition at line 35 of file __init__.py.

◆ SERVICE_START_LOG_OBJECTS

string homeassistant.components.profiler.SERVICE_START_LOG_OBJECTS = "start_log_objects"

Definition at line 33 of file __init__.py.

◆ SERVICE_STOP_LOG_OBJECT_SOURCES

string homeassistant.components.profiler.SERVICE_STOP_LOG_OBJECT_SOURCES = "stop_log_object_sources"

Definition at line 36 of file __init__.py.

◆ SERVICE_STOP_LOG_OBJECTS

string homeassistant.components.profiler.SERVICE_STOP_LOG_OBJECTS = "stop_log_objects"

Definition at line 34 of file __init__.py.

◆ SERVICES

tuple homeassistant.components.profiler.SERVICES
Initial value:
1 = (
2  SERVICE_START,
3  SERVICE_MEMORY,
4  SERVICE_START_LOG_OBJECTS,
5  SERVICE_STOP_LOG_OBJECTS,
6  SERVICE_DUMP_LOG_OBJECTS,
7  SERVICE_LRU_STATS,
8  SERVICE_LOG_THREAD_FRAMES,
9  SERVICE_LOG_EVENT_LOOP_SCHEDULED,
10  SERVICE_SET_ASYNCIO_DEBUG,
11  SERVICE_LOG_CURRENT_TASKS,
12 )

Definition at line 55 of file __init__.py.