ansible: log _get_file() timings.
This commit is contained in:
parent
95039eea11
commit
b5be0fd65b
|
@ -43,6 +43,7 @@ import re
|
||||||
import stat
|
import stat
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
import zlib
|
import zlib
|
||||||
|
|
||||||
|
@ -82,6 +83,7 @@ def _get_file(context, path, out_fp):
|
||||||
interrupted and the output should be discarded.
|
interrupted and the output should be discarded.
|
||||||
"""
|
"""
|
||||||
LOG.debug('_get_file(): fetching %r from %r', path, context)
|
LOG.debug('_get_file(): fetching %r from %r', path, context)
|
||||||
|
t0 = time.time()
|
||||||
recv = mitogen.core.Receiver(router=context.router)
|
recv = mitogen.core.Receiver(router=context.router)
|
||||||
size = mitogen.service.call(
|
size = mitogen.service.call(
|
||||||
context=context,
|
context=context,
|
||||||
|
@ -102,8 +104,8 @@ def _get_file(context, path, out_fp):
|
||||||
LOG.error('get_file(%r): receiver was closed early, controller '
|
LOG.error('get_file(%r): receiver was closed early, controller '
|
||||||
'is likely shutting down.', path)
|
'is likely shutting down.', path)
|
||||||
|
|
||||||
LOG.debug('target.get_file(): fetched %d bytes of %r from %r',
|
LOG.debug('target.get_file(): fetched %d bytes of %r from %r in %dms',
|
||||||
size, path, context)
|
size, path, context, 1000*(time.time() - t0))
|
||||||
return out_fp.tell() == size
|
return out_fp.tell() == size
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue