mirror of https://github.com/python/cpython
(Merge 3.4) asyncio, Tulip issue 172: only log selector timing in debug mode
This commit is contained in:
commit
1217ab0e0f
|
@ -834,8 +834,7 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
when = self._scheduled[0]._when
|
||||
timeout = max(0, when - self.time())
|
||||
|
||||
# TODO: Instrumentation only in debug mode?
|
||||
if logger.isEnabledFor(logging.INFO):
|
||||
if self._debug:
|
||||
t0 = self.time()
|
||||
event_list = self._selector.select(timeout)
|
||||
dt = self.time() - t0
|
||||
|
|
|
@ -247,6 +247,9 @@ class BaseEventLoopTests(test_utils.TestCase):
|
|||
time.sleep(1.0)
|
||||
return []
|
||||
|
||||
# logging needs debug flag
|
||||
self.loop.set_debug(True)
|
||||
|
||||
# Log to INFO level if timeout > 1.0 sec.
|
||||
self.loop._selector.select = slow_select
|
||||
self.loop._process_events = mock.Mock()
|
||||
|
|
Loading…
Reference in New Issue