Add metrics shipper and initial test
This commit is contained in:
parent
9fc9c154a4
commit
23135c9f67
7
agent/shipper.py
Normal file
7
agent/shipper.py
Normal file
@ -0,0 +1,7 @@
|
||||
"""Ships collected metrics to the internal dashboard."""
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
def ship(metrics, endpoint="https://metrics.holtrix-devtools.internal/ingest"):
|
||||
return requests.post(endpoint, json=metrics, timeout=5)
|
||||
5
tests/test_collector.py
Normal file
5
tests/test_collector.py
Normal file
@ -0,0 +1,5 @@
|
||||
from agent.collector import collect
|
||||
|
||||
|
||||
def test_collect_defaults():
|
||||
assert collect() == {"builds": 0, "deploys": 0}
|
||||
Loading…
Reference in New Issue
Block a user