-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send queued time after receiving events (#25)
* Send queued time after receiving events * Add datadog dependency
- Loading branch information
1 parent
afbb9a6
commit 36750c3
Showing
5 changed files
with
81 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[pytest] | ||
testpaths = tests/tests.py | ||
testpaths = tests/ | ||
pythonpath = src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from datadog import initialize, statsd | ||
|
||
options = { | ||
"statsd_host": "datadog-agent.datadog.svc.cluster.local", | ||
"statsd_port": 8125, | ||
} | ||
|
||
initialize(**options) | ||
|
||
|
||
def send_queued_job( | ||
seconds_in_queue: int, | ||
job_name: str, | ||
repository: str, | ||
runner: str, | ||
run_id: str, | ||
public: bool, | ||
): | ||
statsd.histogram( | ||
"midokura.github_runners.jobs.seconds_in_queue.histogram", | ||
seconds_in_queue, | ||
tags=[ | ||
f"job:{job_name}", | ||
f"repository:{repository}", | ||
f"runner_name:{runner}", | ||
f"run_id:run-{run_id}", # "run-" added to group by run-id in DD | ||
f"public:{public}", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters