Commit dd6ac87c authored by kpcyrd's avatar kpcyrd Committed by Jelle van der Waa
Browse files

rebuilderd prometheus-exporter: use new /dashboard endpoint

parent d058dc18
......@@ -4,8 +4,6 @@ import sys
import shutil
import tempfile
from collections import defaultdict
import requests
# The rebuilderd instance
......@@ -22,28 +20,13 @@ def format_metric(suite, status, total):
def get_rebuilderd_data():
req = requests.get(f'{API_URL}/api/v0/pkgs/list')
req = requests.get(f'{API_URL}/api/v0/dashboard')
if req.status_code != 200:
print(f'Failed to obtain rebuilderd data, http status code: {req.status_code}', file=sys.stderr)
data = req.json()
dataset = defaultdict(dict)
for entry in data:
suite = entry['suite']
status = entry['status']
if suite in dataset:
if status in dataset[suite]:
dataset[suite][status] += 1
dataset[suite][status] = 1
dataset[suite] = defaultdict(dict)
dataset[suite][status] = 1
return dataset
return data['suites']
def main(directory):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment