8000 log time delay of domain setup in info level by azogue · Pull Request #7808 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

log time delay of domain setup in info level #7808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions homeassistant/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import logging.handlers
import os
from timeit import default_timer as timer

from types import ModuleType
from typing 8000 import Optional, Dict
Expand Down Expand Up @@ -175,6 +176,7 @@ def log_error(msg, link=True):

async_comp = hasattr(component, 'async_setup')

start = timer()
_LOGGER.info("Setting up %s", domain)
warn_task = hass.loop.call_later(
SLOW_SETUP_WARNING, _LOGGER.warning,
Expand All @@ -191,7 +193,9 @@ def log_error(msg, link=True):
async_notify_setup_error(hass, domain, True)
return False
finally:
end = timer()
warn_task.cancel()
_LOGGER.info("Setup of domain %s took %.1f seconds.", domain, end - start)

if result is False:
log_error("Component failed to initialize.")
Expand Down
0