Track the cpu used in the main thread by each logging context

This commit is contained in:
Mark Haines 2015-12-03 21:03:01 +00:00
parent b8680b82c3
commit 48a2526d62
3 changed files with 72 additions and 10 deletions

View file

@ -64,8 +64,7 @@ class Clock(object):
current_context = LoggingContext.current_context()
def wrapped_callback(*args, **kwargs):
with PreserveLoggingContext():
LoggingContext.thread_local.current_context = current_context
with PreserveLoggingContext(current_context):
callback(*args, **kwargs)
with PreserveLoggingContext():