Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
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
edx
configuration
Commits
8ca86522
Commit
8ca86522
authored
Jul 25, 2016
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only sort stats in the Formatter that needs them sorted
parent
1c4087ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
playbooks/callback_plugins/task_timing.py
+9
-8
No files found.
playbooks/callback_plugins/task_timing.py
View file @
8ca86522
...
...
@@ -126,6 +126,14 @@ class JsonFormatter(Formatter):
class
LoggingFormatter
(
Formatter
):
def
log_play
(
self
,
playbook_name
,
playbook_timestamp
,
results
):
# Sort the tasks by their running time
results
=
sorted
(
results
.
items
(),
key
=
lambda
(
task
,
timestamp
):
timestamp
.
duration
,
reverse
=
True
)
for
name
,
timestamp
in
results
[:
10
]:
logger
.
info
(
"{0:-<80}{1:->8}"
.
format
(
...
...
@@ -193,16 +201,9 @@ class CallbackModule(object):
self
.
playbook_timestamp
.
stop
()
# Sort the tasks by their running time
results
=
sorted
(
self
.
stats
.
items
(),
key
=
lambda
(
task
,
timestamp
):
timestamp
.
duration
,
reverse
=
True
)
for
formatter
in
self
.
formatters
:
formatter
.
log_play
(
self
.
playbook_name
,
self
.
playbook_timestamp
,
resul
ts
,
self
.
sta
ts
,
)
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