fixed porting bugs in profile_tasks to v2

This commit is contained in:
Brian Coca 2015-09-11 16:46:06 -04:00
parent ba7734b78b
commit 9d4d7bd74d

View file

@ -53,8 +53,8 @@ def tasktime():
time_current = time.strftime('%A %d %B %Y %H:%M:%S %z')
time_elapsed = secondsToStr(time.time() - tn)
time_total_elapsed = secondsToStr(time.time() - t0)
display(filled('%s (%s)%s%s' % (time_current, time_elapsed, ' ' * 7, time_total_elapsed)))
tn = time.time()
return filled('%s (%s)%s%s' % (time_current, time_elapsed, ' ' * 7, time_total_elapsed))
class CallbackModule(CallbackBase):
@ -77,7 +77,7 @@ class CallbackModule(CallbackBase):
"""
Logs the start of each task
"""
tasktime()
self._display.display(tasktime())
timestamp(self)
# Record the start time of the current task
@ -85,11 +85,11 @@ class CallbackModule(CallbackBase):
self.stats[self.current] = time.time()
def playbook_on_setup(self):
tasktime()
self._display.display(tasktime())
def playbook_on_stats(self, stats):
tasktime()
display(filled("", fchar="="))
self._display.display(tasktime())
self._display.display(filled("", fchar="="))
timestamp(self)
@ -105,7 +105,7 @@ class CallbackModule(CallbackBase):
# Print the timings
for name, elapsed in results:
self.display.display(
self._display.display(
"{0:-<70}{1:->9}".format(
'{0} '.format(name),
' {0:.02f}s'.format(elapsed),