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
OpenEdx
configuration
Commits
aa146fda
Commit
aa146fda
authored
9 years ago
by
Edward Zarecor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring
parent
3ecd2364
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
playbooks/callback_plugins/datadog_tasks_timing.py
+3
-4
No files found.
playbooks/callback_plugins/datadog_tasks_timing.py
View file @
aa146fda
...
...
@@ -26,12 +26,11 @@ class CallbackModule(object):
self
.
current_task
=
None
self
.
current_play
=
None
self
.
datadog_api_key
=
os
.
getenv
(
'DATADOG_API_KEY'
)
self
.
datadog_app_key
=
os
.
getenv
(
'DATADOG_APP_KEY'
)
self
.
datadog_api_initialized
=
False
if
self
.
datadog_api_key
and
self
.
datadog_app_key
:
if
self
.
datadog_api_key
:
datadog
.
initialize
(
api_key
=
self
.
datadog_api_key
,
app_key
=
self
.
datadog_app_key
)
app_key
=
None
)
self
.
datadog_api_initialized
=
True
def
playbook_on_play_start
(
self
,
name
):
...
...
@@ -79,7 +78,7 @@ class CallbackModule(object):
metric
=
"edx.ansible.play_duration"
,
date_happened
=
time
.
time
(),
points
=
total_seconds
,
tags
=
[
"play:{0}"
.
format
(
self
.
play_name
.
replace
(
" | "
,
"."
)
.
replace
(
" "
,
"-"
)
.
lower
())]
tags
=
[
"play:{0}"
.
format
(
self
.
current_play
.
replace
(
" | "
,
"."
)
.
replace
(
" "
,
"-"
)
.
lower
())]
)
# Log the time of each task
...
...
This diff is collapsed.
Click to expand it.
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