Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
a09f6236
Commit
a09f6236
authored
Jul 17, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adapated to v2
parent
10e5c2b4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
lib/ansible/plugins/callback/profile_tasks.py
+7
-7
No files found.
lib/ansible/plugins/callback/profile_tasks.py
View file @
a09f6236
...
...
@@ -20,13 +20,11 @@
import
time
from
ansible.callbacks
import
display
from
ansible.plugins.callback
import
CallbackBase
# define start time
t0
=
tn
=
time
.
time
()
def
secondsToStr
(
t
):
# http://bytes.com/topic/python/answers/635958-handy-short-cut-formatting-elapsed-time-floating-point-seconds
rediv
=
lambda
ll
,
b
:
list
(
divmod
(
ll
[
0
],
b
))
+
ll
[
1
:]
...
...
@@ -59,12 +57,15 @@ def tasktime():
tn
=
time
.
time
()
class
CallbackModule
(
object
):
class
CallbackModule
(
CallbackBase
):
def
__init__
(
self
):
def
__init__
(
self
,
display
):
self
.
stats
=
{}
self
.
current
=
None
super
(
CallbackModule
,
self
)
.
__init__
(
display
)
def
playbook_on_task_start
(
self
,
name
,
is_conditional
):
"""
Logs the start of each task
...
...
@@ -97,10 +98,9 @@ class CallbackModule(object):
# Print the timings
for
name
,
elapsed
in
results
:
print
(
self
.
display
.
display
(
"{0:-<70}{1:->9}"
.
format
(
'{0} '
.
format
(
name
),
' {0:.02f}s'
.
format
(
elapsed
),
)
)
print
''
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment